Assertion abort on the EXPLAIN for a query containing a simple IN subquery

Bug #919427 reported by Igor Babaev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Igor Babaev

Bug Description

The following test case (a modification of the test case for bug #12838171 from mysql-5.6 code line) causes an assertion abort in mariadb-5.2 on the assertion
`!table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || bitmap_is_set(table->vcol_set, [field_index))'field.cc:7017]

CREATE TABLE ot (
  col_int_nokey int(11),
  col_varchar_nokey varchar(1)
) ;
INSERT INTO ot VALUES (1,'x');
CREATE TABLE it1 (
   col_int_key int(11),
   col_varchar_key varchar(1),
   col_varchar_key2 varchar(1),
   KEY idx_cvk_cvk2_cik (col_varchar_key, col_varchar_key2, col_int_key),
   KEY idx_cvk_cik (col_varchar_key, col_int_key)
);
INSERT INTO it1 VALUES (NULL,'x','x'), (NULL,'f','f');

EXPLAIN
SELECT col_int_nokey FROM ot
WHERE (col_varchar_nokey, 'x') IN
              (SELECT col_varchar_key, col_varchar_key2 FROM it1);

The following EXPLAIN

EXPLAIN
SELECT col_int_nokey FROM ot
WHERE col_varchar_nokey IN
   (SELECT col_varchar_key FROM it2 WHERE col_int_key IS NULL);

 that uses table it2

CREATE TABLE it2(
  col_int_key int(11),
  col_varchar_key varchar(1),
  KEY idx_cvk_cik (col_varchar_key,col_int_key)
) ;
INSERT INTO it2 VALUES (NULL,'x'), (NULL,'f');

erroneously returns
"Impossible WHERE noticed after reading const tables".

Changed in maria:
milestone: none → 5.2
status: New → Confirmed
importance: Undecided → Critical
assignee: nobody → Igor Babaev (igorb-seattle)
Changed in maria:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.