Assertion `!table || (!table->read_set || bitmap_is_set(table->read_set, field_index))' failed with with ICP index_condition_pushdown , multipart keys
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MariaDB |
Fix Released
|
High
|
Sergey Petrunia | ||
Bug 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:
#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:
#12 0x081f16a2 in Arg_comparator:
#13 0x0820dc82 in Item_func_
#14 0x081c9690 in Item::val_bool (this=0xae5133b8) at item.cc:197
#15 0x08215810 in Item_cond_
#16 0x084d2cd3 in index_cond_
#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_
at mi_rkey.c:122
#19 0x084d2e2f in ha_myisam:
at ha_myisam.cc:1786
#20 0x081bb4a2 in handler:
at sql_class.h:3641
#21 0x083f2cf8 in handler:
#22 0x084b97d9 in handler:
#23 0x084b9981 in Mrr_simple_
#24 0x084bbdcc in DsMrr_impl:
#25 0x084d4161 in ha_myisam:
#26 0x083d0e39 in QUICK_RANGE_
#27 0x083e7f41 in find_all_keys (param=0xae8dff04, select=0xae5143b0, sort_keys=
at filesort.cc:569
#28 0x083e6f4b in filesort (thd=0x9f2c6b8, table=0xae62e630, sortorder=
sort_
#29 0x08342442 in create_sort_index (thd=0x9f2c6b8, join=0xae522790, order=0xae513710, filesort_
select_
#30 0x0831f19e in JOIN::exec (this=0xae522790) at sql_select.cc:2613
#31 0x0831fc7e in mysql_select (thd=0x9f2c6b8, rref_pointer_
order=
at sql_select.cc:2891
#32 0x08317b13 in handle_select (thd=0x9f2c6b8, lex=0x9f2ddc0, result=0xae5137b0, setup_tables_
#33 0x082b2efa in execute_
#34 0x082a9cfe in mysql_execute_
#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_
#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_
#37 0x082a6e01 in do_command (thd=0x9f2c6b8) at sql_parse.cc:906
#38 0x082a3e68 in handle_
#39 0x00821919 in start_thread () from /lib/libpthread
#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
full optimizer switch: index_merge=
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,'
(NULL,'ok',NULL),
(796262400,
(7,'STQUF'
(955711488,
SET SESSION optimizer_switch = 'index_
SELECT b
FROM t1
WHERE a != 1 AND c IS NULL
ORDER BY 1;
repeatable with maria-5.3. Not repeatable with maria-5.
| Changed in maria: | |
| assignee: | nobody → Sergey Petrunia (sergefp) |
| milestone: | none → 5.3 |
| Changed in maria: | |
| status: | New → Incomplete |
| status: | Incomplete → Confirmed |
| importance: | Undecided → High |
| Changed in maria: | |
| status: | Confirmed → Fix Committed |
| Changed in maria: | |
| status: | Fix Committed → Fix Released |

The crash has been introduced by this patch:
revno: 3013 :pre_idx_ push_select_ cond :original_ cond would point to the same condition :pre_idx_ push_select_ cond. Otherwise SQL_SELECT: :original_ cond
revision-id: <email address hidden>
parent: <email address hidden>
committer: Igor Babaev <email address hidden>
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:
is not NULL then SQL_SELECT:
as SQL_SELECT:
would be equal to SQL_SELECT::cond.