Got error 124 from storage engine with UNION inside subquery and join_cache_level=3..8
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Oleksandr "Sanja" Byelkin |
Bug Description
When executing the following query:
SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' ) ;
mysqld returned:
ERROR 1030 (HY000): Got error 124 from storage engine
backtrace:
#0 my_error (nr=1030, MyFlags=0) at my_error.c:81
#1 0x083f34ef in handler:
#2 0x0833eb0f in report_error (table=0xa754fa18, error=124) at sql_select.cc:15468
#3 0x0833f549 in join_read_key2 (thd=0xaf82a20, tab=0xa7571840, table=0xa754fa18, table_ref=
#4 0x0833f3da in join_read_key (tab=0xa7571840) at sql_select.cc:15692
#5 0x0833e023 in sub_select (join=0xa7576490, join_tab=
#6 0x0833d8d0 in do_select (join=0xa7576490, fields=0xa754c028, table=0x0, procedure=0x0) at sql_select.cc:14795
#7 0x08322156 in JOIN::exec (this=0xa7576490) at sql_select.cc:2679
#8 0x08322982 in mysql_select (thd=0xaf82a20, rref_pointer_
group=0x0, having=0x0, proc_param=0x0, select_
#9 0x0846fb8c in st_select_
#10 0x0824d00d in subselect_
#11 0x08246bc9 in Item_subselect:
#12 0x08247092 in Item_in_
#13 0x08248be6 in Item_in_
#14 0x081e2714 in Item::val_
#15 0x0820ec74 in Item_in_
#16 0x08320189 in JOIN::exec (this=0xa75619e0) at sql_select.cc:2120
#17 0x08322982 in mysql_select (thd=0xaf82a20, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2900
#18 0x0831a87f in handle_select (thd=0xaf82a20, lex=0xaf84124, result=0xa754c6d0, setup_tables_
#19 0x082b4fec in execute_
#20 0x082abda9 in mysql_execute_
#21 0x082b762d in mysql_parse (thd=0xaf82a20, rawbuf=0xa754b718 "SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' )", length=64,
found_
#22 0x082a99f8 in dispatch_command (command=COM_QUERY, thd=0xaf82a20, packet=0xafa18e1 "SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' )",
packet_
#23 0x082a8e53 in do_command (thd=0xaf82a20) at sql_parse.cc:916
#24 0x082a5e37 in handle_
#25 0x00821919 in start_thread () from /lib/libpthread
#26 0x0076acce in clone () from /lib/libc.so.6
explain:
1 PRIMARY t1 system NULL NULL NULL NULL 1
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3 DEPENDENT UNION NULL NULL NULL NULL NULL NULL NULL No tables used
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
minimal switch: join_cache_level=3
full switch:
index_merge=
bzr version-info:
revision-id: <email address hidden>
date: 2011-11-02 13:51:47 +0400
build-date: 2011-11-02 13:22:20 +0200
revno: 3264
branch-nick: maria-5.3
test case:
CREATE TABLE t1 (
f1 varchar(1) DEFAULT NULL
);
INSERT INTO t1 VALUES ('c');
SET SESSION join_cache_level=8;
SELECT * FROM t1 WHERE t1.f1 IN ( SELECT 'k' UNION SELECT 'e' ) ;
Changed in maria: | |
milestone: | none → 5.3 |
assignee: | nobody → Igor Babaev (igorb-seattle) |
Changed in maria: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in maria: | |
status: | Confirmed → In Progress |
Changed in maria: | |
assignee: | Timour Katchaounov (timour) → Oleksandr "Sanja" Byelkin (sanja-byelkin) |
The problem is in calling add_key_field for the whole UNION
in JOIN::reoptimize.