Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
With particular data, the following query:
SELECT b
FROM t1
WHERE a != 1 AND c IS NULL
ORDER BY 1;
asserts as follows:
mysqld: field.cc:3635: virtual longlong Field_long::val_int(): Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed.
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x082646b8 in Field_long::val_int (this=0xae631400) at field.cc:3635
#10 0x081ce360 in Item_field::val_int (this=0xae5132a8) at item.cc:2280
#11 0x0820c238 in Arg_comparator::compare_int_signed (this=0xae51343c) at item_cmpfunc.cc:1161
#12 0x081f16a2 in Arg_comparator::compare (this=0xae51343c) at item_cmpfunc.h:72
#13 0x0820dc82 in Item_func_ne::val_int (this=0xae5133b8) at item_cmpfunc.cc:1832
#14 0x081c9690 in Item::val_bool (this=0xae5133b8) at item.cc:197
#15 0x08215810 in Item_cond_and::val_int (this=0xae514598) at item_cmpfunc.cc:4426
#16 0x084d2cd3 in index_cond_func_myisam (arg=0xae6306a8) at ha_myisam.cc:1751
#17 0x08512086 in mi_check_index_cond (info=0xae521360, keynr=1, record=0xae630ba0 "\376") at mi_key.c:525
#18 0x084d8328 in mi_rkey (info=0xae521360, buf=0xae630ba0 "\376", inx=1, key=0xae514088 "\001", keypart_map=1, search_flag=HA_READ_KEY_OR_NEXT)
at mi_rkey.c:122
#19 0x084d2e2f in ha_myisam::index_read_map (this=0xae6306a8, buf=0xae630ba0 "\376", key=0xae514088 "\001", keypart_map=1, find_flag=HA_READ_KEY_OR_NEXT)
at ha_myisam.cc:1786
#20 0x081bb4a2 in handler::ha_index_read_map (this=0xae6306a8, buf=0xae630ba0 "\376", key=0xae514088 "\001", keypart_map=1, find_flag=HA_READ_KEY_OR_NEXT)
at sql_class.h:3641
#21 0x083f2cf8 in handler::read_range_first (this=0xae6306a8, start_key=0xae63074c, end_key=0xae63075c, eq_range_arg=false, sorted=false) at handler.cc:4448
#22 0x084b97d9 in handler::multi_range_read_next (this=0xae6306a8, range_info=0xae8dfc28) at multi_range_read.cc:280
#23 0x084b9981 in Mrr_simple_index_reader::get_next (this=0xae630ac8, range_info=0xae8dfc28) at multi_range_read.cc:312
#24 0x084bbdcc in DsMrr_impl::dsmrr_next (this=0xae630a24, range_info=0xae8dfc28) at multi_range_read.cc:1350
#25 0x084d4161 in ha_myisam::multi_range_read_next (this=0xae6306a8, range_info=0xae8dfc28) at ha_myisam.cc:2267
#26 0x083d0e39 in QUICK_RANGE_SELECT::get_next (this=0xae5056a0) at opt_range.cc:10860
#27 0x083e7f41 in find_all_keys (param=0xae8dff04, select=0xae5143b0, sort_keys=0xae527a08, buffpek_pointers=0xae8dfd3c, tempfile=0xae8dfe20, indexfile=0x0)
at filesort.cc:569
#28 0x083e6f4b in filesort (thd=0x9f2c6b8, table=0xae62e630, sortorder=0xae514928, s_length=1, select=0xae5143b0, max_rows=18446744073709551615,
sort_positions=false, examined_rows=0xae8e0070) at filesort.cc:240
#29 0x08342442 in create_sort_index (thd=0x9f2c6b8, join=0xae522790, order=0xae513710, filesort_limit=18446744073709551615,
select_limit=18446744073709551615, is_order_by=false) at sql_select.cc:18042
#30 0x0831f19e in JOIN::exec (this=0xae522790) at sql_select.cc:2613
#31 0x0831fc7e in mysql_select (thd=0x9f2c6b8, rref_pointer_array=0x9f2e234, tables=0xae513050, wild_num=0, fields=..., conds=0xae5135e0, og_num=1,
order=0xae513710, group=0x0, having=0x0, proc_param=0x0, select_options=2147764736, result=0xae5137b0, unit=0x9f2de1c, select_lex=0x9f2e0f8)
at sql_select.cc:2891
#32 0x08317b13 in handle_select (thd=0x9f2c6b8, lex=0x9f2ddc0, result=0xae5137b0, setup_tables_done_option=0) at sql_select.cc:283
#33 0x082b2efa in execute_sqlcom_select (thd=0x9f2c6b8, all_tables=0xae513050) at sql_parse.cc:5087
#34 0x082a9cfe in mysql_execute_command (thd=0x9f2c6b8) at sql_parse.cc:2231
#35 0x082b5536 in mysql_parse (thd=0x9f2c6b8, rawbuf=0xae512ec0 "SELECT b\nFROM t1\nWHERE a != 1 AND c IS NULL\nORDER BY 1", length=54,
found_semicolon=0xae8e1228) at sql_parse.cc:6088
#36 0x082a797b in dispatch_command (command=COM_QUERY, thd=0x9f2c6b8, packet=0x9f85549 "SELECT b\nFROM t1\nWHERE a != 1 AND c IS NULL\nORDER BY 1",
packet_length=54) at sql_parse.cc:1208
#37 0x082a6e01 in do_command (thd=0x9f2c6b8) at sql_parse.cc:906
#38 0x082a3e68 in handle_one_connection (arg=0x9f2c6b8) at sql_connect.cc:1178
#39 0x00821919 in start_thread () from /lib/libpthread.so.0
#40 0x0076acce in clone () from /lib/libc.so.6
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref c,c_2 c_2 5 const 1 Using index condition; Using where; Using filesort
minimal optimizer switch: index_condition_pushdown=on
full 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=on,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=off,in_to_exists=on,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on
bzr version-info
revision-id: <email address hidden>
date: 2011-08-12 14:31:40 +0300
build-date: 2011-08-15 22:41:25 +0300
revno: 3155
branch-nick: maria-5.3
test case:
CREATE TABLE t1 ( a int, b varchar(1024), c int, KEY (c), KEY (c,a)) ;
INSERT INTO t1 VALUES
(NULL,'x','-678428672'),
(NULL,'ok',NULL),
(796262400,'byluovkgwoukfxedyeffsedajyqkyhpaqqpozn', NULL),
(7,'STQUF',146014208),
(955711488,'WWVOR','-1515388928');
SET SESSION optimizer_switch = 'index_condition_pushdown=on';
SELECT b
FROM t1
WHERE a != 1 AND c IS NULL
ORDER BY 1;
repeatable with maria-5.3. Not repeatable with maria-5.2,mysql-5.5, mysql-5.6 (which also includes ICP).
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Re: Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed with with ICP index_condition_pushdown , multipart keys
The crash has been introduced by this patch:
revno: 3013
revision-id: igor@askmonty.org-20110530034814-1tvcr6l95p8j16gh
parent: igor@askmonty.org-20110529050756-tmk8k5dk7a1ihmg3
committer: Igor Babaev <igor@askmonty.org>
branch nick: maria-5.3
timestamp: Sun 2011-05-29 20:48:14 -0700
message:
Eliminated the member original_cond from the class SQL_SELECT
introduced at the latest merge 5.1->5.2->5.3.
It is basically not needed since if SQL_SELECT::pre_idx_push_select_cond
is not NULL then SQL_SELECT::original_cond would point to the same condition
as SQL_SELECT::pre_idx_push_select_cond. Otherwise SQL_SELECT::original_cond
would be equal to SQL_SELECT::cond.