Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
11.3.0
-
None
-
Ubuntu 20.04
Description
Run these queries in release build:
CREATE TABLE x ( x INT ) ;
INSERT INTO x ( x ) VALUES ( 1 ) ;
UPDATE x SET x = 1 WHERE x = 1 ;
INSERT INTO x ( x ) VALUES ( 1 ) , ( 1 ) ;
WITH RECURSIVE x ( x ) AS ( WITH x ( x ) AS ( SELECT 1 GROUP BY 'x' , ( SELECT x AS x FROM x AS x WHERE ( x = 1 AND x = 1 AND x = 1 AND x = 1 AND x = 1 ) GROUP BY x HAVING x ORDER BY ( x < 1 LIKE ( SELECT x FROM x GROUP BY 'x' , 'x' , 'x' , 'x' , 'x' , 'x' HAVING NULL = x WINDOW x AS ( PARTITION BY ( x , x ) NOT IN ( SELECT x , x = x AND x = x FROM x ) ORDER BY x DESC ) ) AND x = 1 ) DESC LIMIT 1 OFFSET 1 ) LIKE ( SELECT * FROM x ORDER BY 1 - x ) HAVING EXISTS ( WITH RECURSIVE x AS ( SELECT 1 ) SELECT * FROM x WHERE x = x ) EXCEPT SELECT x + 1 ) SELECT 1 EXCEPT SELECT x + 1 FROM x ) SELECT - x , x FROM x ;
Will trigger Segmentation fault.
GDB info:
Thread 16 "mariadbd" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffd242e300 (LWP 3630)]
0x00000000009cbe0e in find_field_in_table (thd=<optimized out>, table=<optimized out>, name=<optimized out>, length=<optimized out>, allow_rowid=<optimized out>,
cached_field_index_ptr=0x6290000ba0e0) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:6353
6353 if (cached_field_index < table->s->fields &&
(gdb) p table
$48 = (TABLE *) 0x0
#0 0x00000000009cbe0e in find_field_in_table (thd=<optimized out>, table=<optimized out>, name=<optimized out>, length=<optimized out>, allow_rowid=<optimized out>, cached_field_index_ptr=0x6290000bf0e0) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:6353
#1 0x00000000009cd1e6 in find_field_in_table_ref (thd=<optimized out>, table_list=<optimized out>, name=<optimized out>, length=<optimized out>, item_name=<optimized out>, db_name=<optimized out>, table_name=<optimized out>, ignored_tables=<optimized out>, ref=<optimized out>, check_privileges=<optimized out>, allow_rowid=<optimized out>, cached_field_index_ptr=<optimized out>, register_tree_change=<optimized out>, actual_table=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:6518
#2 0x00000000009ceb58 in find_field_in_tables (thd=<optimized out>, item=<optimized out>, first_table=<optimized out>, last_table=0x0, ignored_tables=<optimized out>, ref=<optimized out>, report_error=<optimized out>, check_privileges=<optimized out>, register_tree_change=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:6833
#3 0x000000000135055a in Item_field::fix_fields (this=<optimized out>, thd=<optimized out>, reference=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item.cc:6013
#4 0x0000000001459380 in Item::fix_fields_if_needed (this=0x3ac, thd=0x62b00016c218, ref=0x6290000bf230) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#5 Item_func::fix_fields (this=<optimized out>, thd=<optimized out>, ref=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item_func.cc:349
#6 0x00000000009d3359 in Item::fix_fields_if_needed (this=0x6290000bf1b0, thd=0x62b00016c218, ref=0x6290000bf278) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#7 Item::fix_fields_if_needed_for_scalar (this=0x6290000bf1b0, thd=0x62b00016c218, ref=0x6290000bf278) at /home/wx/mariadb-11.3.0/sql/item.h:1156
#8 setup_fields (thd=0x62b00016c218, ref_pointer_array=..., fields=..., column_usage=<optimized out>, sum_func_list=sum_func_list@entry=0x62d0000d4a88, pre_fix=0x6290000bede8, allow_sum_func=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_base.cc:8061
#9 0x0000000000bf311c in JOIN::prepare (this=0x62d0000d46e0, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=<optimized out>, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1526
#10 0x0000000000dec22a in st_select_lex_unit::prepare_join (this=this@entry=0x6290000be2d8, thd_arg=<optimized out>, sl=sl@entry=0x6290000beb18, tmp_result=tmp_result@entry=0x62d0000d4508, additional_options=additional_options@entry=0, is_union_select=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1103
#11 0x0000000000de1743 in st_select_lex_unit::prepare (this=0x6290000be2d8, derived_arg=<optimized out>, sel_result=<optimized out>, additional_options=0) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1659
#12 0x0000000000a52e38 in mysql_derived_prepare (thd=<optimized out>, lex=<optimized out>, derived=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:840
#13 0x0000000000a57cc2 in mysql_handle_single_derived (lex=lex@entry=0x62b0001703c8, derived=derived@entry=0x6290000926a8, phases=phases@entry=2) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#14 0x0000000000e7cf8d in TABLE_LIST::handle_derived (this=0x6290000926a8, lex=0x62b0001703c8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9651
#15 0x0000000000ab86cc in LEX::handle_list_of_derived (this=0x62b0001703c8, table_list=<optimized out>, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#16 st_select_lex::handle_derived (this=<optimized out>, lex=0x62b0001703c8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#17 0x0000000000bf2a78 in JOIN::prepare (this=0x62d0000d3e10, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=<optimized out>, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1439
#18 0x00000000015d5c30 in subselect_single_select_engine::prepare (this=<optimized out>, thd=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:3943
#19 0x00000000015b1a8e in Item_subselect::fix_fields (this=<optimized out>, thd_param=<optimized out>, ref=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item_subselect.cc:296
#20 0x0000000001459380 in Item::fix_fields_if_needed (this=0x3ac, thd=0x62b00016c218, ref=0x6290000b7908) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#21 Item_func::fix_fields (this=<optimized out>, thd=<optimized out>, ref=<optimized out>) at /home/wx/mariadb-11.3.0/sql/item_func.cc:349
#22 0x00000000013e04ec in Item_func_like::fix_fields (this=0x6290000b7888, thd=0x62b00016c218, ref=0x6290000bef00) at /home/wx/mariadb-11.3.0/sql/item_cmpfunc.cc:5879
#23 0x0000000000bf8308 in Item::fix_fields_if_needed (this=<optimized out>, thd=<optimized out>, ref=0x6290000bef00) at /home/wx/mariadb-11.3.0/sql/item.h:1147
#24 Item::fix_fields_if_needed_for_scalar (this=<optimized out>, thd=<optimized out>, ref=0x6290000bef00) at /home/wx/mariadb-11.3.0/sql/item.h:1156
#25 Item::fix_fields_if_needed_for_order_by (this=<optimized out>, thd=<optimized out>, ref=0x6290000bef00) at /home/wx/mariadb-11.3.0/sql/item.h:1164
#26 find_order_in_list (thd=<optimized out>, ref_pointer_array=..., tables=<optimized out>, order=0x6290000b7a68, fields=..., all_fields=..., is_group_field=<optimized out>, add_to_all_fields=<optimized out>, from_window_spec=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:27533
#27 0x0000000000ca7d57 in setup_group (thd=thd@entry=0x62b00016c218, ref_pointer_array=..., tables=tables@entry=0x0, fields=..., all_fields=..., order=0x629000091fa8, hidden_group_fields=0x62d0000d2887, from_window_spec=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:27657
#28 0x0000000000bf399e in setup_without_group (thd=<optimized out>, ref_pointer_array=..., tables=0x0, leaves=..., fields=..., all_fields=..., conds=0x62d0000d29c0, order=0x0, group=0x629000091fa8, win_specs=..., win_funcs=..., hidden_group_fields=0x0, reserved=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:951
#29 JOIN::prepare (this=0x62d0000d2530, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=<optimized out>, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1531
#30 0x0000000000dec22a in st_select_lex_unit::prepare_join (this=this@entry=0x6290000bb760, thd_arg=<optimized out>, sl=sl@entry=0x629000091990, tmp_result=tmp_result@entry=0x62d0000d2438, additional_options=additional_options@entry=0, is_union_select=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1103
#31 0x0000000000de1743 in st_select_lex_unit::prepare (this=0x6290000bb760, derived_arg=<optimized out>, sel_result=<optimized out>, additional_options=0) at /home/wx/mariadb-11.3.0/sql/sql_union.cc:1659
#32 0x0000000000a52e38 in mysql_derived_prepare (thd=<optimized out>, lex=<optimized out>, derived=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:840
#33 0x0000000000a57cc2 in mysql_handle_single_derived (lex=lex@entry=0x62b0001703c8, derived=derived@entry=0x6290000bf2f0, phases=phases@entry=2) at /home/wx/mariadb-11.3.0/sql/sql_derived.cc:200
#34 0x0000000000e7cf8d in TABLE_LIST::handle_derived (this=0x6290000bf2f0, lex=0x62b0001703c8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9651
#35 0x0000000000ab86cc in LEX::handle_list_of_derived (this=0x62b0001703c8, table_list=<optimized out>, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#36 st_select_lex::handle_derived (this=<optimized out>, lex=0x62b0001703c8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#37 0x0000000000e7cfc6 in TABLE_LIST::handle_derived (this=0x6290000c0890, lex=0x62b0001703c8, phases=2) at /home/wx/mariadb-11.3.0/sql/table.cc:9648
#38 0x0000000000ab86cc in LEX::handle_list_of_derived (this=0x62b0001703c8, table_list=<optimized out>, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.h:4579
#39 st_select_lex::handle_derived (this=<optimized out>, lex=0x62b0001703c8, phases=2) at /home/wx/mariadb-11.3.0/sql/sql_lex.cc:4989
#40 0x0000000000bf2a78 in JOIN::prepare (this=0x6290000c1918, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=<optimized out>, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:1439
#41 0x0000000000be4c97 in mysql_select (thd=<optimized out>, thd@entry=0x62b00016c218, tables=0x7fffd2428180, fields=..., conds=0x6290000bef00, og_num=0, order=0x1, group=0x0, having=0x0, proc_param=0x0, select_options=<optimized out>, result=0x6290000c18e8, unit=0x62b0001704a8, select_lex=0x6290000c0000) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:5224
#42 0x0000000000be4596 in handle_select (thd=thd@entry=0x62b00016c218, lex=<optimized out>, lex@entry=0x62b0001703c8, result=<optimized out>, result@entry=0x6290000c18e8, setup_tables_done_option=<optimized out>, setup_tables_done_option@entry=0) at /home/wx/mariadb-11.3.0/sql/sql_select.cc:628
#43 0x0000000000b3df18 in execute_sqlcom_select (thd=0x62b00016c218, all_tables=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:6013
#44 0x0000000000b2cd51 in mysql_execute_command (thd=0x62b00016c218, is_called_from_prepared_stmt=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:3912
#45 0x0000000000b1fe79 in mysql_parse (thd=thd@entry=0x62b00016c218, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, parser_state@entry=0x7fffd242ca80) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:7734
#46 0x0000000000b19069 in dispatch_command (command=<optimized out>, thd=0x62b00016c218, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1893
#47 0x0000000000b20b71 in do_command (thd=0x62b00016c218, blocking=true) at /home/wx/mariadb-11.3.0/sql/sql_parse.cc:1406
#48 0x0000000000f03476 in do_handle_one_connection (connect=<optimized out>, put_in_cache=<optimized out>) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1445
#49 0x0000000000f02eb9 in handle_one_connection (arg=arg@entry=0x608002060838) at /home/wx/mariadb-11.3.0/sql/sql_connect.cc:1347
#50 0x0000000001a00c1b in pfs_spawn_thread (arg=0x617000005498) at /home/wx/mariadb-11.3.0/storage/perfschema/pfs.cc:2201
#51 0x00007ffff79f7609 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#52 0x00007ffff770f133 in clone () from /lib/x86_64-linux-gnu/libc.so.6
Attachments
Issue Links
- duplicates
-
MDEV-28506 SIGSEGV's in find_field_in_table[s][_ref], Item_field::fix_fields, create_view_field and MemcmpInterceptorCommon | Assertions `(*select_ref)->fixed' or '->is_fixed' and `table_list->table' failed
-
- Stalled
-
Activity
Transition | Time In Source Status | Execution Times |
---|
|
14d 23h 24m | 1 |