Details
Description
CREATE TABLE t1 (a INT); |
INSERT INTO t1 VALUES (0),(1); |
SELECT a FROM t1 GROUP BY a HAVING NOT a; |
10.4 30ddf961 |
#3 <signal handler called>
|
#4 0x00005638135a7255 in Item_func_not::fix_fields (this=0x7f77080140b0, thd=0x7f7708000b00, ref=0x0) at /data/src/10.4/sql/item_cmpfunc.cc:6307
|
#5 0x00005638131fe022 in st_select_lex::pushdown_from_having_into_where (this=0x7f77080131b0, thd=0x7f7708000b00, having=0x0) at /data/src/10.4/sql/sql_lex.cc:10245
|
#6 0x0000563813262a53 in JOIN::optimize_inner (this=0x7f7708014a70) at /data/src/10.4/sql/sql_select.cc:1966
|
#7 0x00005638132613d4 in JOIN::optimize (this=0x7f7708014a70) at /data/src/10.4/sql/sql_select.cc:1561
|
#8 0x000056381326c1ca in mysql_select (thd=0x7f7708000b00, tables=0x7f7708013778, wild_num=0, fields=..., conds=0x0, og_num=1, order=0x0, group=0x7f7708013f50, having=0x7f77080140b0, proc_param=0x0, select_options=2147748608, result=0x7f7708014a48, unit=0x7f7708004a28, select_lex=0x7f77080131b0) at /data/src/10.4/sql/sql_select.cc:4589
|
#9 0x000056381325c862 in handle_select (thd=0x7f7708000b00, lex=0x7f7708004960, result=0x7f7708014a48, setup_tables_done_option=0) at /data/src/10.4/sql/sql_select.cc:424
|
#10 0x0000563813226261 in execute_sqlcom_select (thd=0x7f7708000b00, all_tables=0x7f7708013778) at /data/src/10.4/sql/sql_parse.cc:6598
|
#11 0x000056381321b524 in mysql_execute_command (thd=0x7f7708000b00) at /data/src/10.4/sql/sql_parse.cc:3887
|
#12 0x0000563813229ff5 in mysql_parse (thd=0x7f7708000b00, rawbuf=0x7f77080130f8 "SELECT a FROM t1 GROUP BY a HAVING NOT a", length=40, parser_state=0x7f7718199180, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8150
|
#13 0x00005638132156e1 in dispatch_command (command=COM_QUERY, thd=0x7f7708000b00, packet=0x7f7708008301 "SELECT a FROM t1 GROUP BY a HAVING NOT a", packet_length=40, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1829
|
#14 0x0000563813213ea1 in do_command (thd=0x7f7708000b00) at /data/src/10.4/sql/sql_parse.cc:1362
|
#15 0x000056381338b937 in do_handle_one_connection (connect=0x563816243040) at /data/src/10.4/sql/sql_connect.cc:1403
|
#16 0x000056381338b69b in handle_one_connection (arg=0x563816243040) at /data/src/10.4/sql/sql_connect.cc:1306
|
#17 0x0000563813cb3135 in pfs_spawn_thread (arg=0x5638162783f0) at /data/src/10.4/storage/perfschema/pfs.cc:1862
|
#18 0x00007f771fb3c4a4 in start_thread (arg=0x7f771819a700) at pthread_create.c:456
|
#19 0x00007f771e084d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
|
Reproducible with MyISAM, Aria, InnoDB.
Non-debug build fails the same way.
No crash with condition_pushdown_from_having=off.
Attachments
Issue Links
- is duplicated by
-
MDEV-26418 A SEGV in Optimizer
-
- Closed
-
-
MDEV-30152 Crash bug on select related functions
-
- Closed
-
-
MDEV-32300 Server crashes at Item_func_not::fix_fields
-
- Closed
-
-
MDEV-32420 Segmentation fault at /mariadb-11.3.0/sql/item_cmpfunc.cc:6552
-
- Closed
-
Leads to:
10.10.0 081a284712bb661349e2e3802077b12211cede3e (Optimized)
Core was generated by `/test/MD310522-mariadb-10.10.0-linux-x86_64-opt/bin/mysqld --no-defaults --core'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000055c86b1cfd0e in Item_func_not::fix_fields (this=0x1491b0013820, thd=
0x1491b0000c58, ref=0x0) at /test/10.10_opt/sql/item_cmpfunc.cc:6445
[Current thread is 1 (Thread 0x1491e4804700 (LWP 2260955))]
(gdb) bt
#0 0x000055c86b1cfd0e in Item_func_not::fix_fields (this=0x1491b0013820, thd=0x1491b0000c58, ref=0x0) at /test/10.10_opt/sql/item_cmpfunc.cc:6445
#1 0x000055c86af36ec2 in st_select_lex::pushdown_from_having_into_where (this=0x1491b0010988, thd=0x1491b0000c58, having=0x0) at /test/10.10_opt/sql/sql_lex.cc:11256
#2 0x000055c86afc09a9 in JOIN::optimize_inner (this=0x1491b0018c70) at /test/10.10_opt/sql/sql_select.cc:2259
#3 0x000055c86afc3b13 in JOIN::optimize (this=this@entry=0x1491b0018c70) at /test/10.10_opt/sql/sql_select.cc:1845
#4 0x000055c86afc3bfe in mysql_select (thd=0x1491b0000c58, tables=0x1491b0011c90, fields=@0x1491b0010c28: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1491b0010f18, last = 0x1491b0010f18, elements = 1}, <No data fields>}, conds=0x1491b00131c0, og_num=2, order=0x0, group=0x1491b0013548, having=0x1491b0013820, proc_param=0x0, select_options=<optimized out>, result=0x1491b0014188, unit=0x1491b0004cb8, select_lex=0x1491b0010988) at /test/10.10_opt/sql/sql_select.cc:5030
#5 0x000055c86afc4397 in handle_select (thd=thd@entry=0x1491b0000c58, lex=lex@entry=0x1491b0004be0, result=result@entry=0x1491b0014188, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.10_opt/sql/sql_select.cc:578
#6 0x000055c86af479b1 in execute_sqlcom_select (thd=0x1491b0000c58, all_tables=0x1491b0011c90) at /test/10.10_opt/sql/sql_parse.cc:6260
#7 0x000055c86af5552d in mysql_execute_command (thd=0x1491b0000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.10_opt/sql/sql_parse.cc:3944
#8 0x000055c86af42bb5 in mysql_parse (rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, thd=0x1491b0000c58) at /test/10.10_opt/sql/sql_parse.cc:8036
#9 mysql_parse (thd=0x1491b0000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.10_opt/sql/sql_parse.cc:7958
#10 0x000055c86af4e6ca in dispatch_command (command=COM_QUERY, thd=0x1491b0000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.10_opt/sql/sql_class.h:1364
#11 0x000055c86af505f2 in do_command (thd=0x1491b0000c58, blocking=blocking@entry=true) at /test/10.10_opt/sql/sql_parse.cc:1407
#12 0x000055c86b0668af in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c86e75a1a8, put_in_cache=put_in_cache@entry=true) at /test/10.10_opt/sql/sql_connect.cc:1418
#13 0x000055c86b066b8d in handle_one_connection (arg=0x55c86e75a1a8) at /test/10.10_opt/sql/sql_connect.cc:1312
#14 0x00001491fd647609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#15 0x00001491fd233133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.4.26 (dbg), 10.4.26 (opt), 10.5.17 (dbg), 10.5.17 (opt), 10.6.9 (dbg), 10.6.9 (opt), 10.7.5 (dbg), 10.7.5 (opt), 10.8.4 (dbg), 10.8.4 (opt), 10.9.2 (dbg), 10.9.2 (opt), 10.10.0 (dbg), 10.10.0 (opt)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.3.36 (dbg), 10.3.36 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)