Assertion `join->best_read < 1.7976931348623157e+308 with table_elimination=on and derived_merge=on
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
High
|
Sergey Petrunia |
Bug Description
Not repeatable without table_eliminati
mysqld: sql_select.cc:5950: bool greedy_
#6 0x00000033b58296e6 in __assert_fail () from /lib64/libc.so.6
#7 0x000000000073c9d2 in greedy_search (join=0x1b2283f0, remaining_tables=5, search_depth=62, prune_level=1) at sql_select.cc:5950
#8 0x000000000073cef1 in choose_plan (join=0x1b2283f0, join_tables=5) at sql_select.cc:5604
#9 0x00000000007483a6 in make_join_
#10 0x000000000074ad00 in JOIN::optimize (this=0x1b2283f0) at sql_select.cc:1101
#11 0x000000000074e839 in mysql_select (thd=0x1b117068, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2875
#12 0x0000000000754c80 in handle_select (thd=0x1b117068, lex=0x1b119470, result=0x1b1c9ef8, setup_tables_
#13 0x00000000006a1a5c in execute_
#14 0x00000000006a373a in mysql_execute_
#15 0x00000000006ac4d3 in mysql_parse (thd=0x1b117068,
rawbuf=
#16 0x00000000006ad36b in dispatch_command (command=COM_QUERY, thd=0x1b117068,
packet=
#17 0x00000000006ae979 in do_command (thd=0x1b117068) at sql_parse.cc:906
#18 0x00000000006993ef in handle_
#19 0x00000033b600673d in start_thread () from /lib64/
#20 0x00000033b58d40cd in clone () from /lib64/libc.so.6
bzr version-info
revision-id: <email address hidden>
date: 2011-07-06 10:30:51 +0400
build-date: 2011-07-06 18:09:42 +0300
revno: 3085
branch-nick: maria-5.3
test case:
CREATE TABLE t1 ( f4 int) ;
CREATE TABLE t2 ( f4 int) ;
CREATE TABLE t3 ( f1 int NOT NULL , PRIMARY KEY (f1)) ;
CREATE TABLE t4 ( f2 int, f4 int) ;
SELECT *
FROM ( SELECT * FROM t1 ) AS alias1
RIGHT JOIN (
t2 AS alias2
LEFT JOIN (
ON t4.f2 = SQ1_alias1.f1
) AS alias3
ON alias3.f4 != 0
) ON alias3.f4 != 0;
Changed in maria: | |
milestone: | none → 5.3 |
Changed in maria: | |
status: | Confirmed → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
I confirm the crash. Based on a quick analysis with GDB, it is hard to decide strategies_ for_picked_ join_order( )
who will handle this bug best. If the value of join->best_read is set to some
number < DBL_MAX just before the ASSERT, then we get a crash inside
fix_semijoin_
in the following line:
if ((handled_tabs & s->table->map) || pos->sj_strategy == SJ_OPT_NONE)
where 's' is NULL.
Since this code is in the area of Sergey, assigning the bug to him.