Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
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::store(longlong, bool): Assertion `!table || (!table->write_set || bitmap_is_set(table->write_set, field_index) || bitmap_is_set(table->vcol_set, field_index))' failed.
1
#6 0x00000033b58296e6 in __assert_fail () from /lib64/libc.so.6
#7 0x0000000000653f64 in Field_longlong::store (this=0x6d11a00, nr=29, unsigned_val=false) at field.cc:3747
#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_records=false) at sql_select.cc:16144
#12 0x000000000072a048 in evaluate_join_record (join=0x6d5fe70, join_tab=0x6d6f860, error=0) at sql_select.cc:15069
#13 0x00000000007333c4 in sub_select (join=0x6d5fe70, join_tab=0x6d6f860, end_of_records=false) at sql_select.cc:14914
#14 0x000000000072a048 in evaluate_join_record (join=0x6d5fe70, join_tab=0x6d6f548, error=0) at sql_select.cc:15069
#15 0x0000000000733252 in sub_select (join=0x6d5fe70, join_tab=0x6d6f548, end_of_records=false) at sql_select.cc:14874
#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_array=0x6c939f8, tables=0x6cd8b20, wild_num=0, fields=..., conds=0x6d0e9c8, og_num=9,
order=0x0, group=0x6d0ebd0, having=0x0, proc_param=0x0, select_options=2147764736, result=0x6d5f7a0, unit=0x6c932f0, select_lex=0x6c937d8)
at sql_select.cc:2885
#19 0x0000000000754016 in handle_select (thd=0x6c90ea8, lex=0x6c93250, result=0x6d5f7a0, setup_tables_done_option=0) at sql_select.cc:283
#20 0x00000000006a14e8 in execute_sqlcom_select (thd=0x6c90ea8, all_tables=0x6cd8b20) at sql_parse.cc:5082
#21 0x00000000006a319b in mysql_execute_command (thd=0x6c90ea8) at sql_parse.cc:2227
#22 0x00000000006abf33 in mysql_parse (thd=0x6c90ea8,
rawbuf=0x6cd7960 "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 field"..., length=493, found_semicolon=0x40968f08) at sql_parse.cc:6083
#23 0x00000000006acdcb in dispatch_command (command=COM_QUERY, thd=0x6c90ea8,
packet=0x6cce5e9 "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 field"..., packet_length=493) at sql_parse.cc:1206
#24 0x00000000006ae3dd in do_command (thd=0x6c90ea8) at sql_parse.cc:904
#25 0x0000000000698e8f in handle_one_connection (arg=0x6c90ea8) at sql_connect.cc:1177
#26 0x00000033b600673d in start_thread () from /lib64/libpthread.so.0
#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,'08:46:48','08:46:48','2005-03-24 07:33:11','2005-03-24 07:33:11','j','j'),(29,8,'14:11:27','14:11:27','2003-06-13 23:19:49','2003-06-13 23:19:49','c','c');
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;