Assertion `tree1->keys[key_no] && tree2->keys[key_no]' in sel_trees_can_be_ored()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Igor Babaev |
Bug Description
The following query:
SELECT * FROM t1
WHERE b BETWEEN 4 AND 5
AND a IN ( 255 , 4 )
OR b IN ( 2 , 14 , 25 )
OR b != 2;
asserts as follows:
mysqld: opt_range.cc:8088: bool sel_trees_
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x083e3ef8 in sel_trees_
#10 0x083d6196 in SEL_IMERGE:
is_
#11 0x083d6a47 in imerge_list_or_tree (param=0xae87f608, merges=0xae87f400, tree=0xae528bb0) at opt_range.cc:1558
#12 0x083e4a29 in tree_or (param=0xae87f608, tree1=0xae528398, tree2=0xae528a78) at opt_range.cc:8411
#13 0x083e1def in get_mm_tree (param=0xae87f608, cond=0xae513b90) at opt_range.cc:7197
#14 0x083d9ef4 in SQL_SELECT:
force_
#15 0x0832e13f in get_quick_
at sql_select.cc:2955
#16 0x0832ff46 in make_join_
#17 0x083281a2 in JOIN::optimize (this=0xae523110) at sql_select.cc:1116
#18 0x0832de5f in mysql_select (thd=0xabd98f8, rref_pointer_
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2892
#19 0x08325cfb in handle_select (thd=0xabd98f8, lex=0xabdaffc, result=0xae513ec8, setup_tables_
#20 0x082c0418 in execute_
#21 0x082b71d5 in mysql_execute_
#22 0x082c2a59 in mysql_parse (thd=0xabd98f8,
rawbuf=
found_
#23 0x082b4e24 in dispatch_command (command=COM_QUERY, thd=0xabd98f8,
packet=
at sql_parse.cc:1221
#24 0x082b427f in do_command (thd=0xabd98f8) at sql_parse.cc:916
#25 0x082b1263 in handle_
#26 0x00821919 in start_thread () from /lib/libpthread
#27 0x0076acce in clone () from /lib/libc.so.6
Observations:
- repeatable on maria-5.3. Not repeatable on MySQL 5.5, maria-5.2, maria-5.5
- EXPLAIN also crashes
- not influenced by any particular switch. The crash happens even with all index_merge switches set to OFF
- no valgrind warnings
optimizer_switch:
index_merge=
bzr version-info:
revision-id: <email address hidden>
date: 2011-11-17 08:00:22 -0800
build-date: 2011-11-18 10:37:37 +0200
revno: 3291
branch-nick: maria-5.3
test case:
CREATE TABLE t1 (a int, b int, PRIMARY KEY (b), KEY (a));
INSERT INTO t1 VALUES (167,9999)
SELECT * FROM t1
WHERE b BETWEEN 4 AND 5
AND a IN ( 255 , 4 )
OR b IN ( 2 , 14 , 25 )
OR b != 2;
Changed in maria: | |
milestone: | none → 5.3 |
description: | updated |
Changed in maria: | |
assignee: | nobody → Igor Babaev (igorb-seattle) |
Changed in maria: | |
status: | New → Confirmed |
importance: | Undecided → Critical |
Changed in maria: | |
status: | Confirmed → In Progress |
Changed in maria: | |
status: | In Progress → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |