Crash in substitute_for_best_equal_field -> eliminate_item_equal -> Item_field::find_item_equal -> Item_equal::contains
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Timour Katchaounov |
Bug Description
Not repeatable in Maria-5.3, though maria-5.3 suffers from a similar crash - bug 601124 . EXPLAIN also crashes.
backtrace:
#5 0x0820d246 in Item_equal:
#6 0x081caeca in Item_field:
#7 0x0831bd86 in eliminate_
#8 0x0831c1fc in substitute_
#9 0x0831c181 in substitute_
#10 0x0831c181 in substitute_
#11 0x083068c2 in JOIN::optimize (this=0xae661470) at sql_select.cc:1026
#12 0x081aecc0 in st_select_
#13 0x083c336b in JOIN::optimize_
#14 0x08307b44 in JOIN::optimize (this=0xae65c5d8) at sql_select.cc:1414
#15 0x0830bb0c in mysql_select (thd=0xb371c38, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2653
#16 0x083045ed in handle_select (thd=0xb371c38, lex=0xb3732d8, result=0xae633380, setup_tables_
#17 0x082a20ac in execute_
#18 0x082990bb in mysql_execute_
#19 0x082a4644 in mysql_parse (thd=0xb371c38,
rawbuf=
#20 0x08296d53 in dispatch_command (command=COM_QUERY, thd=0xb371c38,
packet=
#21 0x08296200 in do_command (thd=0xb371c38) at sql_parse.cc:903
#22 0x082932de in handle_
#23 0x00821919 in start_thread () from /lib/libpthread
#24 0x0076acce in clone () from /lib/libc.so.6
test case:
SET SESSION optimizer_switch = 'semijoin=off';
CREATE TABLE t1 ( f3 int(11), f10 varchar(1), f11 varchar(1)) ;
INSERT IGNORE INTO t1 VALUES (6,'f',
CREATE TABLE t2 ( f12 int(11), f13 int(11)) ;
SELECT * FROM t2
WHERE ( f12 ) IN (
SELECT alias2.f3
FROM t1 AS alias1 JOIN t1 AS alias2 ON alias2.f10 = alias1.f11
WHERE alias1.f11 OR alias1.f3 = 50 AND alias1.f10
);
Related branches
Changed in maria: | |
assignee: | nobody → Timour Katchaounov (timour) |
milestone: | none → 5.3 |
Changed in maria: | |
status: | Confirmed → In Progress |
Changed in maria: | |
status: | In Progress → Fix Released |
Changed in maria: | |
status: | Fix Released → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
Reproducible in 5.3-mwl89 with the following switch: switch= 'materializatio n=off,in_ to_exists= on,semijoin= off';
set @@optimizer_
The bug is not repeatable with materialization.