Comment 2 for bug 611396

Revision history for this message
Philip Stoev (pstoev-askmonty) wrote : Re: RQG: crash in Item_field::register_field_in_read_map with semijoin=off and prepared statements

Still crashes in maria-5.3 and not in maria-5.3-mwl89

simplified test case:

CREATE TABLE t1 ( f1 int(11), f2 int(11)) ;

CREATE TABLE t2 ( f1 int(11), f4 varchar(1), PRIMARY KEY (f1)) ;
INSERT IGNORE INTO t2 VALUES ('23','j'),('24','e');

CREATE TABLE t3 ( f1 int(11), f4 varchar(1)) ;
INSERT IGNORE INTO t3 VALUES ('8','j');

SET SESSION optimizer_switch='semijoin=off';

PREPARE st1 FROM "
SELECT t2.f1, (
        SELECT f2 FROM t1
        WHERE ( 7 ) IN ( SELECT f1 FROM t1 )
)
FROM t2
JOIN t3 ON t3.f4 = t2.f4
WHERE t3.f1 = 8
GROUP BY 1 , 2
";
EXECUTE st1;
EXECUTE st1;