Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || bitmap_is_set(table->vcol_set, field_index))' failed with views in maria-5.3
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Critical
|
Igor Babaev |
Bug Description
Not repeatable with maria-5.2, mysql-5.1 . Seems to require views and non-integer field types. Further simplification of the query was not successful.
backtrace:
mysqld: field.cc:3747: virtual int Field_longlong:
1
#6 0x00000033b58296e6 in __assert_fail () from /lib64/libc.so.6
#7 0x0000000000653f64 in Field_longlong:
#8 0x000000000084e193 in do_field_int (copy=0x6d77600) at field_conv.cc:351
#9 0x000000000084df12 in do_copy_maybe_null (copy=0x6d77600) at field_conv.cc:254
#10 0x000000000071d256 in copy_fields (param=0x6d65d10) at sql_select.cc:19261
#11 0x000000000072c2fc in end_update (join=0x6d5fe70, join_tab=0x6d6fb78, end_of_
#12 0x000000000072a048 in evaluate_
#13 0x00000000007333c4 in sub_select (join=0x6d5fe70, join_tab=0x6d6f860, end_of_
#14 0x000000000072a048 in evaluate_
#15 0x0000000000733252 in sub_select (join=0x6d5fe70, join_tab=0x6d6f548, end_of_
#16 0x0000000000734586 in do_select (join=0x6d5fe70, fields=0x0, table=0x6d7af50, procedure=0x0) at sql_select.cc:14539
#17 0x00000000007520ce in JOIN::exec (this=0x6d5fe70) at sql_select.cc:2224
#18 0x000000000074dc3c in mysql_select (thd=0x6c90ea8, rref_pointer_
order=0x0, group=0x6d0ebd0, having=0x0, proc_param=0x0, select_
at sql_select.cc:2885
#19 0x0000000000754016 in handle_select (thd=0x6c90ea8, lex=0x6c93250, result=0x6d5f7a0, setup_tables_
#20 0x00000000006a14e8 in execute_
#21 0x00000000006a319b in mysql_execute_
#22 0x00000000006abf33 in mysql_parse (thd=0x6c90ea8,
rawbuf=
#23 0x00000000006acdcb in dispatch_command (command=COM_QUERY, thd=0x6c90ea8,
packet=
#24 0x00000000006ae3dd in do_command (thd=0x6c90ea8) at sql_parse.cc:904
#25 0x0000000000698e8f in handle_
#26 0x00000033b600673d in start_thread () from /lib64/
#27 0x00000033b58d40cd in clone () from /lib64/libc.so.6
explain:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 Using temporary; Using filesort
1 SIMPLE alias1 ALL NULL NULL NULL NULL 2 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where
test case:
SET SESSION join_cache_level=0; # to avoid JKL references in stack trace
CREATE TABLE t1 ( f1 int NOT NULL , f10 varchar(32)) ;
INSERT IGNORE INTO t1 VALUES (20,'r');
CREATE TABLE t2 ( f1 int NOT NULL , f3 int, f6 time, f7 time, f8 datetime, f9 datetime, f10 varchar(1) COLLATE latin1_swedish_ci, f11 varchar(1) COLLATE latin1_swedish_ci) ;
INSERT IGNORE INTO t2 VALUES (28,NULL,
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1;
CREATE OR REPLACE VIEW v2 AS SELECT * FROM t2;
EXPLAIN SELECT COUNT( alias2.f10 ) , alias1.f11 AS field13 , alias2.f1 AS field14 , alias1.f10 AS field16 , alias2.f10 AS field17 , alias1.f3 AS field18 , alias1.f10 AS field19 , alias1.f6 AS field20 , alias1.f3 AS field21 , alias2.f6 AS field22 FROM t2 AS alias1 RIGHT JOIN v2 AS alias2 RIGHT JOIN v1 AS alias3 ON alias3.f1 ON alias3.f10 > alias2.f10 WHERE alias1.f1 GROUP BY field13 , field14 , field16 , field17 , field18 , field19 , field20 , field21 , field22;
Changed in maria: | |
milestone: | none → 5.3 |
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 |
Simplified test case:
CREATE TABLE t1 ( f1 int NOT NULL , f2 int NOT NULL ) ;
INSERT INTO t1 VALUES (214,0),(6,6);
CREATE TABLE t2 ( f2 int) ;
INSERT INTO t2 VALUES (88),(88);
CREATE ALGORITHM=MERGE VIEW v2 AS SELECT t1.f1, t2.f2 FROM (t2 LEFT JOIN t1 ON (t2.f2 <> t1.f1)) WHERE (t1.f2 <= 'up') ;
SELECT f1 , MIN(f2) FROM v2 GROUP BY f1;
backtrace:
#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6 :store (this=0xae529640, nr=88, unsigned_val=false) at field.cc:3747 hybrid: :reset_ field (this=0xae5127d0) at item_sum.cc:1823 sum_functions (func_ptr= 0xae52b60c) at sql_select.cc:19545 0xae52c378, end_of_ records= false) at sql_select.cc:16183 :generate_ full_extensions (this=0xae531d68, rec_ptr=0xae525f90 "\375X") at sql_join_ cache.cc: 2322 :join_matching_ records (this=0xae531d68, skip_last=false) at sql_join_ cache.cc: 2215 :join_records (this=0xae531d68, skip_last=false) at sql_join_ cache.cc: 2014 0xae52c174, end_of_ records= true) at sql_select.cc:14655 0xae52bf70, end_of_ records= true) at sql_select.cc:14817 array=0xaf64198 , tables=0xae5128e0, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, 0xae512bd8, having=0x0, proc_param=0x0, select_ options= 2147764736, result=0xae52aef0, unit=0xaf63d9c, select_ lex=0xaf64078) at sql_select.cc:2885 done_option= 0) at sql_select.cc:283 sqlcom_ select (thd=0xaf62680, all_tables= 0xae5128e0) at sql_parse.cc:5082 command (thd=0xaf62680) at sql_parse.cc:2227 =0xae8a0228) one_connection (arg=0xaf62680) at sql_connect.cc:1177 .so.0
#9 0x08263da3 in Field_longlong:
#10 0x081ea570 in Item_sum_
#11 0x08343c19 in init_tmptable_
#12 0x0833c3de in end_update (join=0xae52c9b0, join_tab=
#13 0x082ef874 in JOIN_CACHE:
#14 0x082ef62e in JOIN_CACHE:
#15 0x082ef190 in JOIN_CACHE:
#16 0x08338bcd in sub_select_cache (join=0xae52c9b0, join_tab=
#17 0x08338de5 in sub_select (join=0xae52c9b0, join_tab=
#18 0x083388d4 in do_select (join=0xae52c9b0, fields=0x0, table=0xae533c28, procedure=0x0) at sql_select.cc:14541
#19 0x0831bfc9 in JOIN::exec (this=0xae52c9b0) at sql_select.cc:2224
#20 0x0831e150 in mysql_select (thd=0xaf62680, rref_pointer_
group=
#21 0x0831601b in handle_select (thd=0xaf62680, lex=0xaf63d40, result=0xae52aef0, setup_tables_
#22 0x082b174b in execute_
#23 0x082a854f in mysql_execute_
#24 0x082b3d87 in mysql_parse (thd=0xaf62680, rawbuf=0xae5125e0 "SELECT f1 , MIN(f2) FROM v2 GROUP BY f1", length=39, found_semicolon
at sql_parse.cc:6083
#25 0x082a61eb in dispatch_command (command=COM_QUERY, thd=0xaf62680, packet=0xafbd1c9 "SELECT f1 , MIN(f2) FROM v2 GROUP BY f1", packet_length=39)
at sql_parse.cc:1206
#26 0x082a5671 in do_command (thd=0xaf62680) at sql_parse.cc:904
#27 0x082a26ec in handle_
#28 0x00821919 in start_thread () from /lib/libpthread
#29 0x0076acce in clone () from /lib/libc.so.6