#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x083e3ef8 in sel_trees_can_be_ored (param=0xae87f608, tree1=0xae5294f0, tree2=0xae529148, common_keys=0xae87f330) at opt_range.cc:8088
#10 0x083d6196 in SEL_IMERGE::or_sel_tree_with_checks (this=0xae529380, param=0xae87f608, n_trees=2, tree=0xae529148, is_first_check_pass=false,
is_last_check_pass=0xae87f39b) at opt_range.cc:1173
#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::test_quick_select (this=0xae5147c0, thd=0xabd98f8, keys_to_use=..., prev_tables=0, limit=18446744073709551615,
force_quick_range=false, ordered_output=false) at opt_range.cc:3041
#15 0x0832e13f in get_quick_record_count (thd=0xabd98f8, select=0xae5147c0, table=0xae6175f8, keys=0xae514400, limit=18446744073709551615)
at sql_select.cc:2955
#16 0x0832ff46 in make_join_statistics (join=0xae523110, tables_list=..., conds=0xae513b90, keyuse_array=0xae528250) at sql_select.cc:3470
#17 0x083281a2 in JOIN::optimize (this=0xae523110) at sql_select.cc:1116
#18 0x0832de5f in mysql_select (thd=0xabd98f8, rref_pointer_array=0xabdb474, tables=0xae5130a0, wild_num=1, fields=..., conds=0xae513b90, og_num=0,
order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0xae513ec8, unit=0xabdb058, select_lex=0xabdb338)
at sql_select.cc:2892
#19 0x08325cfb in handle_select (thd=0xabd98f8, lex=0xabdaffc, result=0xae513ec8, setup_tables_done_option=0) at sql_select.cc:283
#20 0x082c0418 in execute_sqlcom_select (thd=0xabd98f8, all_tables=0xae5130a0) at sql_parse.cc:5112
#21 0x082b71d5 in mysql_execute_command (thd=0xabd98f8) at sql_parse.cc:2250
#22 0x082c2a59 in mysql_parse (thd=0xabd98f8,
rawbuf=0xae512ec0 "SELECT * FROM t1\nWHERE b BETWEEN 4 AND 5\nAND a IN ( 255 , 4 ) \nOR b IN ( 2 , 14 , 25 ) \nOR b != 2", length=97,
found_semicolon=0xae883228) at sql_parse.cc:6113
#23 0x082b4e24 in dispatch_command (command=COM_QUERY, thd=0xabd98f8,
packet=0xac32789 "SELECT * FROM t1\nWHERE b BETWEEN 4 AND 5\nAND a IN ( 255 , 4 ) \nOR b IN ( 2 , 14 , 25 ) \nOR b != 2", packet_length=97)
at sql_parse.cc:1221
#24 0x082b427f in do_command (thd=0xabd98f8) at sql_parse.cc:916
#25 0x082b1263 in handle_one_connection (arg=0xabd98f8) at sql_connect.cc:1191
#26 0x00821919 in start_thread () from /lib/libpthread.so.0
#27 0x0076acce in clone () from /lib/libc.so.6
Observations:
- repeatable on maria-5.3. Not repeatable on MySQL 5.5 or maria-5.2
- EXPLAIN also crashes
- not influenced by any particular switch. The crash happens even with all index_merge switches set to OFF
- no valgrind warnings
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_ can_be_ ored(RANGE_ OPT_PARAM* , SEL_TREE*, SEL_TREE*, key_map*): Assertion `tree1- >keys[key_ no] && tree2-> keys[key_ no]' failed.
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6 can_be_ ored (param=0xae87f608, tree1=0xae5294f0, tree2=0xae529148, common_ keys=0xae87f330 ) at opt_range.cc:8088 :or_sel_ tree_with_ checks (this=0xae529380, param=0xae87f608, n_trees=2, tree=0xae529148, is_first_ check_pass= false, last_check_ pass=0xae87f39b ) at opt_range.cc:1173 :test_quick_ select (this=0xae5147c0, thd=0xabd98f8, keys_to_use=..., prev_tables=0, limit=184467440 73709551615, quick_range= false, ordered_ output= false) at opt_range.cc:3041 record_ count (thd=0xabd98f8, select=0xae5147c0, table=0xae6175f8, keys=0xae514400, limit=184467440 73709551615) statistics (join=0xae523110, tables_list=..., conds=0xae513b90, keyuse_ array=0xae52825 0) at sql_select.cc:3470 array=0xabdb474 , tables=0xae5130a0, wild_num=1, fields=..., conds=0xae513b90, og_num=0, options= 2147764736, result=0xae513ec8, unit=0xabdb058, select_ lex=0xabdb338) done_option= 0) at sql_select.cc:283 sqlcom_ select (thd=0xabd98f8, all_tables= 0xae5130a0) at sql_parse.cc:5112 command (thd=0xabd98f8) at sql_parse.cc:2250 0xae512ec0 "SELECT * FROM t1\nWHERE b BETWEEN 4 AND 5\nAND a IN ( 255 , 4 ) \nOR b IN ( 2 , 14 , 25 ) \nOR b != 2", length=97, semicolon= 0xae883228) at sql_parse.cc:6113 0xac32789 "SELECT * FROM t1\nWHERE b BETWEEN 4 AND 5\nAND a IN ( 255 , 4 ) \nOR b IN ( 2 , 14 , 25 ) \nOR b != 2", packet_length=97) one_connection (arg=0xabd98f8) at sql_connect.cc:1191 .so.0
#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 or maria-5.2
- 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= on,index_ merge_union= on,index_ merge_sort_ union=on, index_merge_ intersection= on,index_ merge_sort_ intersection= off,index_ condition_ pushdown= off,derived_ merge=off, derived_ with_keys= off,firstmatch= on,loosescan= on,materializat ion=off, in_to_exists= on,semijoin= on,partial_ match_rowid_ merge=on, partial_ match_table_ scan=on, subquery_ cache=on, mrr=off, mrr_cost_ based=off, mrr_sort_ keys=off, outer_join_ with_cache= off,semijoin_ with_cache= off,join_ cache_increment al=on,join_ cache_hashed= on,join_ cache_bka= on,optimize_ join_buffer_ size=off, table_eliminati on=on
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)); ,(168,10000) ;
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;