Server crashes on 2nd execution of PS in find_field_in_tables with semijoin+materialization, DISTINCT, view, aggregate function in IN subquery
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Sergey Petrunia |
Bug Description
See also https:/
#4 <signal handler called>
#5 0x0833b05e in find_field_
ref=0x9477f88, report_
at sql_base.cc:6581
#6 0x0820554a in Item_field:
#7 0x0823f684 in Item_in_
at item_cmpfunc.
#8 0x0823face in Item_in_
at item_cmpfunc.
#9 0x0833dce2 in setup_tables (thd=0x93efae0, context=0x94775f8, from_clause=
leaves=..., select_
#10 0x0833de77 in setup_tables_
tables=
full_
#11 0x083516ca in JOIN::prepare (this=0x94c6818, rref_pointer_
wild_num=0, conds_init=0x0, og_num=0, order_init=0x0, group_init=0x0, having_init=0x0,
proc_
#12 0x084b185d in st_select_
additional_
#13 0x084b4701 in mysql_derived_
at sql_derived.cc:625
#14 0x084b3e32 in mysql_handle_
at sql_derived.cc:176
#15 0x0834fa76 in TABLE_LIST:
#16 0x081e7368 in st_select_
#17 0x083515f3 in JOIN::prepare (this=0x94b9c28, rref_pointer_
wild_num=0, conds_init=
proc_
#18 0x0835925d in mysql_select (thd=0x93efae0, rref_pointer_
fields=..., conds=0x94785f0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0,
select_
#19 0x08350f7f in handle_select (thd=0x93efae0, lex=0x947f698, result=0x9481158, setup_tables_
at sql_select.cc:285
#20 0x082ec085 in execute_
#21 0x082e3461 in mysql_execute_
#22 0x083a5bb6 in Prepared_
at sql_prepare.cc:3732
#23 0x083a50cb in Prepared_
open_
#24 0x083a3993 in mysql_sql_
#25 0x082e3487 in mysql_execute_
#26 0x082ee6c0 in mysql_parse (thd=0x93efae0, rawbuf=0x945ec10 "EXECUTE pstmt", length=13,
found_
#27 0x082e10a1 in dispatch_command (command=COM_QUERY, thd=0x93efae0, packet=0x9449351 "EXECUTE pstmt",
packet_
#28 0x082e054b in do_command (thd=0x93efae0) at sql_parse.cc:923
#29 0x082dd4d1 in handle_
#30 0xb76efb25 in start_thread () from /lib/libpthread
bzr version-info
revision-id: <email address hidden>
date: 2012-03-05 22:33:46 -0800
build-date: 2012-03-11 20:50:07 +0400
revno: 3455
Also reproducible on MariaDB 5.5 (revno 3316).
Not reproducible on MySQL 5.6 (trunk revno 3706).
EXPLAIN:
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1 100.00 Using temporary
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Distinct; Using join buffer (incremental, BNL join)
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select distinct `test`.`t1`.`a` AS `a` from <materialize> (select min(`test`
Minimal optimizer_switch: materialization
Full optimizer_switch (default): index_merge=
Test case:
SET optimizer_switch = 'materializatio
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (2),(3);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t2 ( b VARCHAR(1) );
INSERT INTO t2 VALUES ('v'),('v');
PREPARE pstmt FROM
'SELECT DISTINCT a FROM v1, t2
WHERE b IN ( SELECT MIN(b) FROM t2 )';
EXECUTE pstmt;
EXECUTE pstmt;
Changed in maria: | |
assignee: | Alexey Botchkov (holyfoot) → nobody |
importance: | Undecided → Critical |
Changed in maria: | |
assignee: | nobody → Sergey Petrunia (sergefp) |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
EXPLAIN shows "Using join buffer" but that part is irrelevant, the crash happens without use of join buffer,too