[MDEV-2666] LP:919427 - Assertion abort on the EXPLAIN for a query containing a simple IN subquery Created: 2012-01-20  Updated: 2015-02-02  Resolved: 2012-10-04

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Igor Babaev Assignee: Igor Babaev
Resolution: Fixed Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug919427.xml    

 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".



 Comments   
Comment by Rasmus Johansson (Inactive) [ 2012-02-20 ]

Launchpad bug id: 919427

Generated at Thu Feb 08 06:43:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.