[MDEV-7911] crash in Item_cond::eval_not_null_tables Created: 2015-04-05  Updated: 2015-04-21  Resolved: 2015-04-21

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 5.3.12, 5.5, 10.0, 10.1
Fix Version/s: 5.5.43

Type: Bug Priority: Major
Reporter: sbester1 Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: semi-join, verified
Environment:

Windows, Linux



 Description   

Version: '10.0.17-MariaDB'  socket: ''  port: 3306  mariadb.org binary distribution
[ERROR] mysqld got exception 0xc0000005 ;
mysqld.exe!Item_func_eq::val_int()[item_cmpfunc.cc:1934]
mysqld.exe!Item_cond::eval_not_null_tables()[item_cmpfunc.cc:4451]
mysqld.exe!Item_func::walk()[item_func.cc:303]
mysqld.exe!Item_cond::walk()[item_cmpfunc.cc:4520]
mysqld.exe!st_select_lex::update_used_tables()[sql_lex.cc:3860]
mysqld.exe!JOIN::optimize_inner()[sql_select.cc:1127]
mysqld.exe!JOIN::optimize()[sql_select.cc:1024]
mysqld.exe!mysql_select()[sql_select.cc:3296]
mysqld.exe!handle_select()[sql_select.cc:373]
mysqld.exe!execute_sqlcom_select()[sql_parse.cc:5262]
mysqld.exe!mysql_execute_command()[sql_parse.cc:2550]
mysqld.exe!mysql_parse()[sql_parse.cc:6522]
mysqld.exe!dispatch_command()[sql_parse.cc:1303]
mysqld.exe!do_command()[sql_parse.cc:1003]
mysqld.exe!threadpool_process_request()[threadpool_common.cc:233]
mysqld.exe!io_completion_callback()[threadpool_win.cc:568]

You may get this error instead of crash, so maybe a client charset matters, or check under valgrind on linux:

mysql> explain select 1 from t1 where _cp932 "1" in (select '1' from t1);
ERROR 1267 (HY000): Illegal mix of collations (cp932_japanese_ci,COERCIBLE) and (latin1_swedish_ci,COERCIBLE) for operation '='

How to repeat
-----------------

drop table if exists t1;
create table t1(a int)engine=innodb;
insert into t1 values(1),(2),(3),(null);
select 1 from t1 where _cp932 "1" in (select '1' from t1);



 Comments   
Comment by Elena Stepanova [ 2015-04-05 ]

Debug assertion failure, stack trace from 5.5 commit cc84ac3b

5.5/sql/item_cmpfunc.cc:1868: virtual longlong Item_func_eq::val_int(): Assertion `fixed == 1' failed.
150405 23:34:17 [ERROR] mysqld got signal 6 ;
 
#6  0x00007fac3a15a311 in *__GI___assert_fail (assertion=0xe11634 "fixed == 1", file=<optimized out>, line=1868, function=0xe13340 "virtual longlong Item_func_eq::val_int()") at assert.c:81
#7  0x000000000081c876 in Item_func_eq::val_int (this=0x7fac34e88db0) at 5.5/sql/item_cmpfunc.cc:1868
#8  0x000000000082573e in Item_cond::eval_not_null_tables (this=0x7fac34e88f20, opt_arg=0x0) at 5.5/sql/item_cmpfunc.cc:4386
#9  0x0000000000842d2e in Item_func::walk (this=0x7fac34e88f20, processor=&virtual table offset 736, walk_subquery=false, argument=0x0) at 5.5/sql/item_func.cc:304
#10 0x0000000000825a68 in Item_cond::walk (this=0x7fac34e88f20, processor=&virtual table offset 736, walk_subquery=false, arg=0x0) at 5.5/sql/item_cmpfunc.cc:4454
#11 0x000000000062bde9 in st_select_lex::update_used_tables (this=0x7fac35d53a60) at 5.5/sql/sql_lex.cc:3862
#12 0x0000000000665015 in JOIN::optimize (this=0x7fac34d69078) at 5.5/sql/sql_select.cc:1014
#13 0x000000000066c45b in mysql_select (thd=0x7fac35d50060, rref_pointer_array=0x7fac35d53cd0, tables=0x7fac34e87240, wild_num=0, fields=..., conds=0x7fac34e889f0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x7fac34e88c70, unit=0x7fac35d53380, select_lex=0x7fac35d53a60) at 5.5/sql/sql_select.cc:3080
#14 0x0000000000662fbd in handle_select (thd=0x7fac35d50060, lex=0x7fac35d532d0, result=0x7fac34e88c70, setup_tables_done_option=0) at 5.5/sql/sql_select.cc:319
#15 0x000000000063c1fc in execute_sqlcom_select (thd=0x7fac35d50060, all_tables=0x7fac34e87240) at 5.5/sql/sql_parse.cc:4689
#16 0x00000000006353de in mysql_execute_command (thd=0x7fac35d50060) at 5.5/sql/sql_parse.cc:2234
#17 0x000000000063ece2 in mysql_parse (thd=0x7fac35d50060, rawbuf=0x7fac34e87078 "select 1 from t1 where _cp932 \"1\" in (select '1' from t1)", length=57, parser_state=0x7fac357b5620) at 5.5/sql/sql_parse.cc:5909
#18 0x0000000000632925 in dispatch_command (command=COM_QUERY, thd=0x7fac35d50060, packet=0x7fac35e09061 "select 1 from t1 where _cp932 \"1\" in (select '1' from t1)", packet_length=57) at 5.5/sql/sql_parse.cc:1079
#19 0x0000000000631ab1 in do_command (thd=0x7fac35d50060) at 5.5/sql/sql_parse.cc:793
#20 0x0000000000734122 in do_handle_one_connection (thd_arg=0x7fac35d50060) at 5.5/sql/sql_connect.cc:1266
#21 0x0000000000733be1 in handle_one_connection (arg=0x7fac35d50060) at 5.5/sql/sql_connect.cc:1181
#22 0x0000000000b6c629 in pfs_spawn_thread (arg=0x7fac35d71fc0) at 5.5/storage/perfschema/pfs.cc:1015
#23 0x00007fac3bf54b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#24 0x00007fac3a20a95d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112

Generated at Thu Feb 08 07:23:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.