Crash in test_if_skip_sort_order() with RIGHT JOIN + STRAIGHT JOIN
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Igor Babaev |
Bug Description
The following query:
SELECT STRAIGHT_JOIN t1.a
FROM t1
RIGHT JOIN t2 ON t1.b = t2.b
WHERE
( t1.b NOT BETWEEN 1 AND 7 OR t1.a IS NULL AND t1.b = t2.b )
AND t2.b = 4
GROUP BY 1 ;
crashes as follows:
#4 0x0000000000741c11 in test_if_
at sql_select.cc:17652
#5 0x000000000074fdef in JOIN::optimize (this=0x181da4b0) at sql_select.cc:1548
#6 0x0000000000751b6d in mysql_select (thd=0x2aaab507
og_num=1, order=0x0, group=0x181d1fd8, having=0x0, proc_param=0x0, select_
select_
#7 0x000000000075803c in handle_select (thd=0x2aaab507
#8 0x00000000006a40ea in execute_
#9 0x00000000006a61ca in mysql_execute_
#10 0x00000000006aef63 in mysql_parse (thd=0x2aaab507
rawbuf=
#11 0x00000000006afaf1 in dispatch_command (command=COM_QUERY, thd=0x2aaab5071e18,
packet=
#12 0x00000000006b112f in do_command (thd=0x2aaab507
#13 0x000000000069b93f in handle_
#14 0x00000033b600673d in start_thread () from /lib64/
#15 0x00000033b58d40cd in clone () from /lib64/libc.so.6
explain also crashes. repeatable on maria-5.1,5.2,5.3. Not repeatable on mysql 5.1, 5.5 . May be one of the test_if_
Test case:
--source include/
CREATE TABLE t1 ( a integer, b integer, KEY (a), PRIMARY KEY (b)) ENGINE=InnoDB;
CREATE TABLE t2 (b integer, PRIMARY KEY (b));
INSERT INTO t2 VALUES (4),(9);
SELECT STRAIGHT_JOIN t1.a
FROM t1
RIGHT JOIN t2 ON t1.b = t2.b
WHERE
( t1.b NOT BETWEEN 1 AND 7 OR t1.a IS NULL AND t1.b = t2.b )
AND t2.b = 4
GROUP BY 1;
Changed in maria: | |
importance: | Undecided → Critical |
status: | New → In Progress |
milestone: | none → 5.3 |
Changed in maria: | |
milestone: | 5.3 → 5.1 |
Changed in maria: | |
status: | In Progress → Confirmed |
Changed in maria: | |
assignee: | Oleksandr "Sanja" Byelkin (sanja-byelkin) → Igor Babaev (igorb-seattle) |
Changed in maria: | |
status: | Confirmed → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
Assigning to sanja since it may be a GROUP BY / sorting bug.