EXPLAIN EXTENDED crashes in TABLE_LIST::print with limited max_join_size, materialization=ON,semijoin=ON
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Undecided
|
Sergey Petrunia |
Bug Description
#4 <signal handler called>
#5 0x0838396a in TABLE_LIST::print (this=0x9470e70, thd=0x93eaa98,
eliminated_
at sql_select.cc:21380
#6 0x083832a8 in print_table_array (thd=0x93eaa98, eliminated_
str=0x4894e718, table=0x9472068, end=0x9472074, query_type=
at sql_select.cc:21218
#7 0x083836bc in print_join (thd=0x93eaa98, eliminated_
str=0x4894e718, tables=0x93ec594, query_type=
at sql_select.cc:21312
#8 0x0838408f in st_select_
str=0x4894e718, query_type=
#9 0x081e5a24 in st_select_
query_
#10 0x082ebd1e in execute_
at sql_parse.cc:5133
#11 0x082e3204 in mysql_execute_
#12 0x082ee463 in mysql_parse (thd=0x93eaa98,
rawbuf=
#13 0x082e0e66 in dispatch_command (command=COM_QUERY, thd=0x93eaa98,
packet=
#14 0x082e0310 in do_command (thd=0x93eaa98) at sql_parse.cc:922
#15 0x082dd2d5 in handle_
#16 0x400c2b25 in start_thread () from /lib/libpthread
Apparently it's a leftover from bug#901506.
Now the additional condition is that max_join_size is set to a non-default value. In the test case it's unrealistically small, but in fact the threshold depends on the number of rows in t2. 20 rows was as low as I could reach still getting the crash, and it requires the max size value of ~ 80. A more complicated test case with ~300 rows in the table was still causing the crash with max_join_
The SELECT itself fails with ER_TOO_BIG_SELECT.
bzr version-info
revision-id: <email address hidden>
date: 2011-12-16 08:05:14 -0800
build-date: 2011-12-19 19:54:00 +0400
revno: 3358
branch-nick: maria-5.3
Not reproducible on revno 3250.
Minimal optimizer_switch: materialization
Full optimizer_switch: index_merge=
Test case:
CREATE TABLE t1 ( a INT );
CREATE TABLE t2 ( b INT );
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES
(1),(
(6),(
(11),
(16),
SET optimizer_switch = 'materializatio
SET max_join_size = 80;
EXPLAIN EXTENDED
SELECT COUNT(*) FROM t1
WHERE a IN
( SELECT b FROM t2 GROUP BY b )
AND ( 6 ) IN
( SELECT MIN( t2.b ) FROM t2 alias1, t2 );
Changed in maria: | |
status: | New → Fix Committed |
Fix released with 5.3.3-rc.