CREATEPROCEDURE sp() SELECT * FROM t1 JOIN t2 JOIN t3 USING (x);
--error ER_BAD_FIELD_ERROR
CALL sp;
--error ER_BAD_FIELD_ERROR
CALL sp;
# Cleanup
DROPPROCEDURE sp;
DROPTABLE t1, t2, t3;
10.2 5ecaf52d
#3 <signal handler called>
#4 0x000055ed2eb66d9a in Field_iterator_natural_join::next (this=0x7f340c7d6a60) at /data/src/10.2/sql/table.cc:6015
#5 0x000055ed2eb67a12 in Field_iterator_table_ref::next (this=0x7f340c7d6a10) at /data/src/10.2/sql/table.cc:6085
#6 0x000055ed2e77f919 in mark_common_columns (thd=0x62a000060270, table_ref_1=0x62500009e020, table_ref_2=0x6250000ce7d8, using_fields=0x6250000ef4e0, found_using_fields=0x7f340c7d6ce0) at /data/src/10.2/sql/sql_base.cc:6528
#7 0x000055ed2e780ed2 in store_top_level_join_columns (thd=0x62a000060270, table_ref=0x62500009d990, left_neighbor=0x0, right_neighbor=0x0) at /data/src/10.2/sql/sql_base.cc:6974
#8 0x000055ed2e78194c in setup_natural_join_row_types (thd=0x62a000060270, from_clause=0x6250000cdb30, context=0x6250000cd9e0) at /data/src/10.2/sql/sql_base.cc:7096
#9 0x000055ed2e784f91 in setup_tables (thd=0x62a000060270, context=0x6250000cd9e0, from_clause=0x6250000cdb30, tables=0x6250000ee778, leaves=..., select_insert=false, full_table_list=false) at /data/src/10.2/sql/sql_base.cc:7514
#10 0x000055ed2e78530c in setup_tables_and_check_access (thd=0x62a000060270, context=0x6250000cd9e0, from_clause=0x6250000cdb30, tables=0x6250000ee778, leaves=..., select_insert=false, want_access_first=1, want_access=1, full_table_list=false) at /data/src/10.2/sql/sql_base.cc:7553
#11 0x000055ed2e92edb6 in JOIN::prepare (this=0x6250000f0368, tables_init=0x6250000ee778, wild_num=1, conds_init=0x0, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x6250000cd990, unit_arg=0x6250000cd250) at /data/src/10.2/sql/sql_select.cc:728
#12 0x000055ed2e94f049 in mysql_select (thd=0x62a000060270, tables=0x6250000ee778, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x6250000f0340, unit=0x6250000cd250, select_lex=0x6250000cd990) at /data/src/10.2/sql/sql_select.cc:3815
#13 0x000055ed2e92bd02 in handle_select (thd=0x62a000060270, lex=0x6250000cd190, result=0x6250000f0340, setup_tables_done_option=0) at /data/src/10.2/sql/sql_select.cc:361
#14 0x000055ed2e8a2bed in execute_sqlcom_select (thd=0x62a000060270, all_tables=0x6250000ee778) at /data/src/10.2/sql/sql_parse.cc:6248
#15 0x000055ed2e88fb92 in mysql_execute_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:3559
#16 0x000055ed2e6de09a in sp_instr_stmt::exec_core (this=0x6250000ef5d0, thd=0x62a000060270, nextp=0x7f340c7d9210) at /data/src/10.2/sql/sp_head.cc:3332
#17 0x000055ed2e6dcbc7 in sp_lex_keeper::reset_lex_and_exec_core (this=0x6250000ef610, thd=0x62a000060270, nextp=0x7f340c7d9210, open_tables=false, instr=0x6250000ef5d0) at /data/src/10.2/sql/sp_head.cc:3095
#18 0x000055ed2e6dd90e in sp_instr_stmt::execute (this=0x6250000ef5d0, thd=0x62a000060270, nextp=0x7f340c7d9210) at /data/src/10.2/sql/sp_head.cc:3248
#19 0x000055ed2e6d1c6e in sp_head::execute (this=0x6250000ed990, thd=0x62a000060270, merge_da_on_success=true) at /data/src/10.2/sql/sp_head.cc:1326
#20 0x000055ed2e6d6439 in sp_head::execute_procedure (this=0x6250000ed990, thd=0x62a000060270, args=0x62a000064bb0) at /data/src/10.2/sql/sp_head.cc:2202
#21 0x000055ed2e88bb55 in do_execute_sp (thd=0x62a000060270, sp=0x6250000ed990) at /data/src/10.2/sql/sql_parse.cc:2981
#22 0x000055ed2e89dc85 in mysql_execute_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:5599
#23 0x000055ed2e8ac16a in mysql_parse (thd=0x62a000060270, rawbuf=0x62b000000290 "CALL sp", length=7, parser_state=0x7f340c7dac90, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7763
#24 0x000055ed2e8851af in dispatch_command (command=COM_QUERY, thd=0x62a000060270, packet=0x6290000eb271 "CALL sp", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
#25 0x000055ed2e881f6e in do_command (thd=0x62a000060270) at /data/src/10.2/sql/sql_parse.cc:1381
#26 0x000055ed2ec0a925 in do_handle_one_connection (connect=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1336
#27 0x000055ed2ec0a1e8 in handle_one_connection (arg=0x611000005470) at /data/src/10.2/sql/sql_connect.cc:1241
#28 0x000055ed2ffa6aac in pfs_spawn_thread (arg=0x616000009ff0) at /data/src/10.2/storage/perfschema/pfs.cc:1869
#29 0x00007f3417538609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#30 0x00007f3417112293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Reproducible on all of 5.5-10.6, with at least MyISAM, InnoDB, Aria.
A non-debug build didn't crash on my machine, but since it's a SIGSEGV, probably it's just the matter of luck.
There was a very similar bug MDEV-16957, closed as fixed. Apparently it only partially fixed the problem.
Attachments
Issue Links
relates to
MDEV-16957Server crashes in Field_iterator_natural_join::next upon 2nd execution of SP
[Current thread is 1 (Thread 0x14b3f4e9f700 (LWP 29453))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1 0x0000562110e82c9e in my_write_core (sig=sig@entry=11) at /test/10.6_dbg/mysys/stacktrace.c:424
#2 0x0000562110621b07 in handle_fatal_signal (sig=11) at /test/10.6_dbg/sql/signal_handler.cc:343
#3 <signal handler called>
#4 0x0000562110463042 in Field_iterator_natural_join::next (this=0x14b3f4e9c620) at /test/10.6_dbg/sql/table.cc:6876
#5 0x000056211046dd07 in Field_iterator_table_ref::next (this=this@entry=0x14b3f4e9c5d0) at /test/10.6_dbg/sql/table.cc:6946
#6 0x00005621102c6234 in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x0, table_ref_2=0x14b3bc02f290, table_ref_1=0x14b3bc04d270, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_base.cc:6956
#7 store_top_level_join_columns (thd=thd@entry=0x14b3bc000db8, table_ref=table_ref@entry=0x14b3bc02f960, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /test/10.6_dbg/sql/sql_base.cc:7370
#8 0x00005621102d4088 in setup_natural_join_row_types (context=0x14b3bc02cda0, from_clause=0x14b3bc02cf10, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_base.cc:7492
#9 setup_tables (thd=thd@entry=0x14b3bc000db8, context=context@entry=0x14b3bc02cda0, from_clause=from_clause@entry=0x14b3bc02cf10, tables=tables@entry=0x14b3bc02e4f0, leaves=@0x14b3bc02cf88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3bc0a82e8, last = 0x14b3bc0a8308, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7912
#10 0x00005621102d4266 in setup_tables_and_check_access (thd=thd@entry=0x14b3bc000db8, context=0x14b3bc02cda0, from_clause=0x14b3bc02cf10, tables=0x14b3bc02e4f0, leaves=@0x14b3bc02cf88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3bc0a82e8, last = 0x14b3bc0a8308, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, want_access_first=DELETE_ACL, want_access=SELECT_ACL, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7954
#11 0x000056211081bdba in mysql_multi_delete_prepare (thd=thd@entry=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_lex.h:3160
#12 0x0000562110362f08 in mysql_execute_command (thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:4831
#13 0x000056211027f597 in sp_instr_stmt::exec_core (this=0x14b3bc02e030, thd=<optimized out>, nextp=0x14b3f4e9d24c) at /test/10.6_dbg/sql/sp_head.cc:3770
#14 0x000056211028ccd2 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x14b3bc02e078, thd=thd@entry=0x14b3bc000db8, nextp=nextp@entry=0x14b3f4e9d24c, open_tables=open_tables@entry=false, instr=instr@entry=0x14b3bc02e030) at /test/10.6_dbg/sql/sp_head.cc:3497
#15 0x000056211028d867 in sp_instr_stmt::execute (this=0x14b3bc02e030, thd=0x14b3bc000db8, nextp=0x14b3f4e9d24c) at /test/10.6_dbg/sql/sp_head.cc:3676
#16 0x00005621102854e7 in sp_head::execute (this=this@entry=0x14b3bc027960, thd=thd@entry=0x14b3bc000db8, merge_da_on_success=merge_da_on_success@entry=true) at /test/10.6_dbg/sql/sp_head.cc:1437
#17 0x0000562110287562 in sp_head::execute_procedure (this=0x14b3bc027960, thd=thd@entry=0x14b3bc000db8, args=0x14b3bc005e78) at /test/10.6_dbg/sql/sp_head.cc:2451
#18 0x00005621103531b4 in do_execute_sp (thd=thd@entry=0x14b3bc000db8, sp=sp@entry=0x14b3bc027960) at /test/10.6_dbg/sql/sql_parse.cc:3007
#19 0x0000562110358bee in Sql_cmd_call::execute (this=0x14b3bc013c60, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:3253
#20 0x000056211036620d in mysql_execute_command (thd=thd@entry=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:5973
#21 0x000056211034ca02 in mysql_parse (thd=thd@entry=0x14b3bc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b3f4e9e410) at /test/10.6_dbg/sql/sql_parse.cc:8004
#22 0x000056211035b726 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b3bc000db8, packet=packet@entry=0x14b3bc00b369 "CALL p2 (@a,@c)", packet_length=packet_length@entry=15, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
#23 0x000056211035eac7 in do_command (thd=0x14b3bc000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1399
#24 0x00005621104b8176 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562113825538, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#25 0x00005621104b877b in handle_one_connection (arg=arg@entry=0x562113825538) at /test/10.6_dbg/sql/sql_connect.cc:1312
#26 0x0000562110966253 in pfs_spawn_thread (arg=0x562113749b48) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#27 0x000014b40a22e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#28 0x000014b409e1d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Roel Van de Paar
added a comment - Ran into this one also
CREATE TABLE t1 (c1 INT,c2 INT);
CREATE TABLE t2 (c INT,c2 INT);
CREATE PROCEDURE p2 (OUT i INT,OUT o INT) READS SQL DATA DELETE a2,a3 FROM t1 AS a1 JOIN t2 AS a2 NATURAL JOIN t2 AS a3;
CALL p2 (@c,@a);
CALL p2 (@a,@c);
Leads to:
10.6.0 f74704c7d963ddcd1109843a5861c6bd76409c8d (Debug)
Core was generated by `/test/MD120421-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x14b3f4e9f700 (LWP 29453))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1 0x0000562110e82c9e in my_write_core (sig=sig@entry=11) at /test/10.6_dbg/mysys/stacktrace.c:424
#2 0x0000562110621b07 in handle_fatal_signal (sig=11) at /test/10.6_dbg/sql/signal_handler.cc:343
#3 <signal handler called>
#4 0x0000562110463042 in Field_iterator_natural_join::next (this=0x14b3f4e9c620) at /test/10.6_dbg/sql/table.cc:6876
#5 0x000056211046dd07 in Field_iterator_table_ref::next (this=this@entry=0x14b3f4e9c5d0) at /test/10.6_dbg/sql/table.cc:6946
#6 0x00005621102c6234 in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x0, table_ref_2=0x14b3bc02f290, table_ref_1=0x14b3bc04d270, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_base.cc:6956
#7 store_top_level_join_columns (thd=thd@entry=0x14b3bc000db8, table_ref=table_ref@entry=0x14b3bc02f960, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /test/10.6_dbg/sql/sql_base.cc:7370
#8 0x00005621102d4088 in setup_natural_join_row_types (context=0x14b3bc02cda0, from_clause=0x14b3bc02cf10, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_base.cc:7492
#9 setup_tables (thd=thd@entry=0x14b3bc000db8, context=context@entry=0x14b3bc02cda0, from_clause=from_clause@entry=0x14b3bc02cf10, tables=tables@entry=0x14b3bc02e4f0, leaves=@0x14b3bc02cf88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3bc0a82e8, last = 0x14b3bc0a8308, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7912
#10 0x00005621102d4266 in setup_tables_and_check_access (thd=thd@entry=0x14b3bc000db8, context=0x14b3bc02cda0, from_clause=0x14b3bc02cf10, tables=0x14b3bc02e4f0, leaves=@0x14b3bc02cf88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3bc0a82e8, last = 0x14b3bc0a8308, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, want_access_first=DELETE_ACL, want_access=SELECT_ACL, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7954
#11 0x000056211081bdba in mysql_multi_delete_prepare (thd=thd@entry=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_lex.h:3160
#12 0x0000562110362f08 in mysql_execute_command (thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:4831
#13 0x000056211027f597 in sp_instr_stmt::exec_core (this=0x14b3bc02e030, thd=<optimized out>, nextp=0x14b3f4e9d24c) at /test/10.6_dbg/sql/sp_head.cc:3770
#14 0x000056211028ccd2 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x14b3bc02e078, thd=thd@entry=0x14b3bc000db8, nextp=nextp@entry=0x14b3f4e9d24c, open_tables=open_tables@entry=false, instr=instr@entry=0x14b3bc02e030) at /test/10.6_dbg/sql/sp_head.cc:3497
#15 0x000056211028d867 in sp_instr_stmt::execute (this=0x14b3bc02e030, thd=0x14b3bc000db8, nextp=0x14b3f4e9d24c) at /test/10.6_dbg/sql/sp_head.cc:3676
#16 0x00005621102854e7 in sp_head::execute (this=this@entry=0x14b3bc027960, thd=thd@entry=0x14b3bc000db8, merge_da_on_success=merge_da_on_success@entry=true) at /test/10.6_dbg/sql/sp_head.cc:1437
#17 0x0000562110287562 in sp_head::execute_procedure (this=0x14b3bc027960, thd=thd@entry=0x14b3bc000db8, args=0x14b3bc005e78) at /test/10.6_dbg/sql/sp_head.cc:2451
#18 0x00005621103531b4 in do_execute_sp (thd=thd@entry=0x14b3bc000db8, sp=sp@entry=0x14b3bc027960) at /test/10.6_dbg/sql/sql_parse.cc:3007
#19 0x0000562110358bee in Sql_cmd_call::execute (this=0x14b3bc013c60, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:3253
#20 0x000056211036620d in mysql_execute_command (thd=thd@entry=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:5973
#21 0x000056211034ca02 in mysql_parse (thd=thd@entry=0x14b3bc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b3f4e9e410) at /test/10.6_dbg/sql/sql_parse.cc:8004
#22 0x000056211035b726 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b3bc000db8, packet=packet@entry=0x14b3bc00b369 "CALL p2 (@a,@c)", packet_length=packet_length@entry=15, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
#23 0x000056211035eac7 in do_command (thd=0x14b3bc000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1399
#24 0x00005621104b8176 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562113825538, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#25 0x00005621104b877b in handle_one_connection (arg=arg@entry=0x562113825538) at /test/10.6_dbg/sql/sql_connect.cc:1312
#26 0x0000562110966253 in pfs_spawn_thread (arg=0x562113749b48) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#27 0x000014b40a22e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#28 0x000014b409e1d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.38 (opt), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)
CREATE PROCEDURE p (INOUT i1 INT,INOUT i2 TIME) DETERMINISTIC SELECT (SELECT (SELECT SUM(DISTINCT 'q')) OR (SELECT c3 FROM t AS a1 STRAIGHT_JOIN t AS a2 NATURAL JOIN t2 AS a3)) AND (SELECT (SELECT (SELECT c3 FROM t) AND(SELECT c3,c FROM t AS a1 JOIN t2 AS a2))) OR ( (SELECT c FROM t2) AND(SELECT c3,c FROM t)) OR (SELECT * FROM t);
#8 0x00005627a6de3ca2 in Field_iterator_table_ref::set_field_iterator (this=this@entry=0x14cda8b047c0) at /test/10.6_dbg/sql/table.cc:6895
#9 0x00005627a6de3dce in Field_iterator_table_ref::set (this=this@entry=0x14cda8b047c0, table=table@entry=0x14cd6c03da80) at /test/10.6_dbg/sql/table.cc:6939
#10 0x00005627a6c3bead in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x0, table_ref_2=0x14cd6c03cc70, table_ref_1=0x14cd6c03da80, thd=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_base.cc:6921
#11 store_top_level_join_columns (thd=thd@entry=0x14cd6c000db8, table_ref=table_ref@entry=0x14cd6c03d340, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /test/10.6_dbg/sql/sql_base.cc:7370
#12 0x00005627a6c4a088 in setup_natural_join_row_types (context=0x14cd6c03b208, from_clause=0x14cd6c03b378, thd=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_base.cc:7492
#13 setup_tables (thd=thd@entry=0x14cd6c000db8, context=context@entry=0x14cd6c03b208, from_clause=from_clause@entry=0x14cd6c03b378, tables=tables@entry=0x14cd6c03b770, leaves=@0x14cd6c03b3f0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14cd6c0c89a0, last = 0x14cd6c0c89c0, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7912
#14 0x00005627a6c4a266 in setup_tables_and_check_access (thd=0x14cd6c000db8, context=0x14cd6c03b208, from_clause=0x14cd6c03b378, tables=0x14cd6c03b770, leaves=@0x14cd6c03b3f0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14cd6c0c89a0, last = 0x14cd6c0c89c0, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, want_access_first=SELECT_ACL, want_access=SELECT_ACL, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7954
#15 0x00005627a6d3ca65 in JOIN::prepare (this=0x14cd6c0c8428, tables_init=<optimized out>, conds_init=<optimized out>, og_num=0, order_init=<optimized out>, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14cd6c03b1b0, unit_arg=0x14cd6c02c480) at /test/10.6_dbg/sql/sql_select.cc:1171
#16 0x00005627a70ab872 in subselect_single_select_engine::prepare (this=0x14cd6c03c108, thd=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_lex.h:1357
#17 0x00005627a70aa9b8 in Item_subselect::fix_fields (this=0x14cd6c03bf60, thd_param=<optimized out>, ref=0x14cd6c03c258) at /test/10.6_dbg/sql/item_subselect.cc:289
#18 0x00005627a6feeef4 in Item::fix_fields_if_needed (ref=0x14cd6c03c258, thd=0x14cd6c000db8, this=0x14cd6c03bf60) at /test/10.6_dbg/sql/item.h:996
#19 Item::fix_fields_if_needed_for_scalar (ref=0x14cd6c03c258, thd=0x14cd6c000db8, this=0x14cd6c03bf60) at /test/10.6_dbg/sql/item.h:992
#20 Item::fix_fields_if_needed_for_bool (ref=0x14cd6c03c258, thd=0x14cd6c000db8, this=0x14cd6c03bf60) at /test/10.6_dbg/sql/item.h:996
#21 Item_cond::fix_fields (this=0x14cd6c03c148, thd=0x14cd6c000db8, ref=<optimized out>) at /test/10.6_dbg/sql/item_cmpfunc.cc:4901
#22 0x00005627a6c49528 in Item::fix_fields_if_needed (ref=0x14cd6c03c268, thd=0x14cd6c000db8, this=0x14cd6c03c148) at /test/10.6_dbg/sql/sql_list.h:199
#23 Item::fix_fields_if_needed_for_scalar (ref=0x14cd6c03c268, thd=0x14cd6c000db8, this=0x14cd6c03c148) at /test/10.6_dbg/sql/item.h:992
#26 0x00005627a70ab872 in subselect_single_select_engine::prepare (this=0x14cd6c03c490, thd=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_lex.h:1357
#27 0x00005627a70aa9b8 in Item_subselect::fix_fields (this=0x14cd6c03c2e8, thd_param=<optimized out>, ref=0x14cd6c032470) at /test/10.6_dbg/sql/item_subselect.cc:289
#28 0x00005627a6feeef4 in Item::fix_fields_if_needed (ref=0x14cd6c032470, thd=0x14cd6c000db8, this=0x14cd6c03c2e8) at /test/10.6_dbg/sql/item.h:996
#29 Item::fix_fields_if_needed_for_scalar (ref=0x14cd6c032470, thd=0x14cd6c000db8, this=0x14cd6c03c2e8) at /test/10.6_dbg/sql/item.h:992
#30 Item::fix_fields_if_needed_for_bool (ref=0x14cd6c032470, thd=0x14cd6c000db8, this=0x14cd6c03c2e8) at /test/10.6_dbg/sql/item.h:996
#31 Item_cond::fix_fields (this=0x14cd6c032f70, thd=0x14cd6c000db8, ref=<optimized out>) at /test/10.6_dbg/sql/item_cmpfunc.cc:4901
#32 0x00005627a6feeef4 in Item::fix_fields_if_needed (ref=0x14cd6c036228, thd=0x14cd6c000db8, this=0x14cd6c032f70) at /test/10.6_dbg/sql/item.h:996
#33 Item::fix_fields_if_needed_for_scalar (ref=0x14cd6c036228, thd=0x14cd6c000db8, this=0x14cd6c032f70) at /test/10.6_dbg/sql/item.h:992
#34 Item::fix_fields_if_needed_for_bool (ref=0x14cd6c036228, thd=0x14cd6c000db8, this=0x14cd6c032f70) at /test/10.6_dbg/sql/item.h:996
#35 Item_cond::fix_fields (this=0x14cd6c036128, thd=0x14cd6c000db8, ref=<optimized out>) at /test/10.6_dbg/sql/item_cmpfunc.cc:4901
#36 0x00005627a6c49528 in Item::fix_fields_if_needed (ref=0x14cd6c036480, thd=0x14cd6c000db8, this=0x14cd6c036128) at /test/10.6_dbg/sql/sql_list.h:199
#37 Item::fix_fields_if_needed_for_scalar (ref=0x14cd6c036480, thd=0x14cd6c000db8, this=0x14cd6c036128) at /test/10.6_dbg/sql/item.h:992
#39 0x00005627a6d3cde3 in JOIN::prepare (this=this@entry=0x14cd6c0c72e8, tables_init=tables_init@entry=0x0, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14cd6c028eb8, unit_arg=0x14cd6c038588) at /test/10.6_dbg/sql/sql_select.cc:1245
#40 0x00005627a6d55fad in mysql_select (thd=thd@entry=0x14cd6c000db8, tables=0x0, fields=@0x14cd6c029008: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14cd6c036478, last = 0x14cd6c036478, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x14cd6c0c72c0, unit=0x14cd6c038588, select_lex=0x14cd6c028eb8) at /test/10.6_dbg/sql/sql_select.cc:4725
#41 0x00005627a6d562e5 in handle_select (thd=thd@entry=0x14cd6c000db8, lex=lex@entry=0x14cd6c0384c0, result=result@entry=0x14cd6c0c72c0, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:419
#42 0x00005627a6cc98b1 in execute_sqlcom_select (thd=thd@entry=0x14cd6c000db8, all_tables=0x14cd6c03b770) at /test/10.6_dbg/sql/sql_parse.cc:6231
#43 0x00005627a6cd6609 in mysql_execute_command (thd=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_parse.cc:3927
#44 0x00005627a6bf5597 in sp_instr_stmt::exec_core (this=0x14cd6c05d2a0, thd=<optimized out>, nextp=0x14cda8b0624c) at /test/10.6_dbg/sql/sp_head.cc:3770
#45 0x00005627a6c02cd2 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x14cd6c05d2e8, thd=thd@entry=0x14cd6c000db8, nextp=nextp@entry=0x14cda8b0624c, open_tables=open_tables@entry=false, instr=instr@entry=0x14cd6c05d2a0) at /test/10.6_dbg/sql/sp_head.cc:3497
#46 0x00005627a6c03867 in sp_instr_stmt::execute (this=0x14cd6c05d2a0, thd=0x14cd6c000db8, nextp=0x14cda8b0624c) at /test/10.6_dbg/sql/sp_head.cc:3676
#47 0x00005627a6bfb4e7 in sp_head::execute (this=this@entry=0x14cd6c027960, thd=thd@entry=0x14cd6c000db8, merge_da_on_success=merge_da_on_success@entry=true) at /test/10.6_dbg/sql/sp_head.cc:1437
#48 0x00005627a6bfd562 in sp_head::execute_procedure (this=0x14cd6c027960, thd=thd@entry=0x14cd6c000db8, args=0x14cd6c005e78) at /test/10.6_dbg/sql/sp_head.cc:2451
#49 0x00005627a6cc91b4 in do_execute_sp (thd=thd@entry=0x14cd6c000db8, sp=sp@entry=0x14cd6c027960) at /test/10.6_dbg/sql/sql_parse.cc:3007
#50 0x00005627a6ccebee in Sql_cmd_call::execute (this=0x14cd6c013c60, thd=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_parse.cc:3253
#51 0x00005627a6cdc20d in mysql_execute_command (thd=thd@entry=0x14cd6c000db8) at /test/10.6_dbg/sql/sql_parse.cc:5973
#52 0x00005627a6cc2a02 in mysql_parse (thd=thd@entry=0x14cd6c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14cda8b07410) at /test/10.6_dbg/sql/sql_parse.cc:8004
#53 0x00005627a6cd1726 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14cd6c000db8, packet=packet@entry=0x14cd6c00b369 "CALL p (@b,@c)", packet_length=packet_length@entry=14, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
#54 0x00005627a6cd4ac7 in do_command (thd=0x14cd6c000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1399
#55 0x00005627a6e2e176 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5627a97742d8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#56 0x00005627a6e2e77b in handle_one_connection (arg=arg@entry=0x5627a97742d8) at /test/10.6_dbg/sql/sql_connect.cc:1312
#57 0x00005627a72dc253 in pfs_spawn_thread (arg=0x5627a9698aa8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#58 0x000014cdbee9b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#59 0x000014cdbea8a293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
#8 0x000055d9fd530efa in Field_iterator_table_ref::set_field_iterator (this=this@entry=0x1497d40c8740) at /data/10.5_dbg/sql/table.cc:6811
#9 0x000055d9fd531026 in Field_iterator_table_ref::set (this=this@entry=0x1497d40c8740, table=table@entry=0x14978802fea0) at /data/10.5_dbg/sql/table.cc:6855
#10 0x000055d9fd385a0c in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x0, table_ref_2=0x14978802f090, table_ref_1=0x14978802fea0, thd=0x149788000db8) at /data/10.5_dbg/sql/sql_base.cc:6895
#11 store_top_level_join_columns (thd=thd@entry=0x149788000db8, table_ref=table_ref@entry=0x14978802f760, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /data/10.5_dbg/sql/sql_base.cc:7344
#12 0x000055d9fd393da1 in setup_natural_join_row_types (context=0x14978802d620, from_clause=0x14978802d790, thd=0x149788000db8) at /data/10.5_dbg/sql/sql_base.cc:7466
#13 setup_tables (thd=thd@entry=0x149788000db8, context=context@entry=0x14978802d620, from_clause=from_clause@entry=0x14978802d790, tables=tables@entry=0x14978802db80, leaves=@0x14978802d808: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1497880c35e0, last = 0x1497880c3600, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, full_table_list=false) at /data/10.5_dbg/sql/sql_base.cc:7886
#14 0x000055d9fd393f7f in setup_tables_and_check_access (thd=0x149788000db8, context=0x14978802d620, from_clause=0x14978802d790, tables=0x14978802db80, leaves=@0x14978802d808: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1497880c35e0, last = 0x1497880c3600, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, want_access_first=SELECT_ACL, want_access=SELECT_ACL, full_table_list=false) at /data/10.5_dbg/sql/sql_base.cc:7928
#15 0x000055d9fd489ab9 in JOIN::prepare (this=0x1497880c3068, tables_init=<optimized out>, conds_init=<optimized out>, og_num=0, order_init=<optimized out>, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x14978802d5c8, unit_arg=0x149788030a30) at /data/10.5_dbg/sql/sql_select.cc:1169
#16 0x000055d9fd7fbfd4 in subselect_single_select_engine::prepare (this=0x14978802e4e8, thd=0x149788000db8) at /data/10.5_dbg/sql/sql_lex.h:1352
#17 0x000055d9fd7fb11a in Item_subselect::fix_fields (this=0x14978802e340, thd_param=<optimized out>, ref=0x14978802e638) at /data/10.5_dbg/sql/item_subselect.cc:289
#18 0x000055d9fd74007c in Item::fix_fields_if_needed (ref=0x14978802e638, thd=0x149788000db8, this=0x14978802e340) at /data/10.5_dbg/sql/item.h:996
#19 Item::fix_fields_if_needed_for_scalar (ref=0x14978802e638, thd=0x149788000db8, this=0x14978802e340) at /data/10.5_dbg/sql/item.h:992
#20 Item::fix_fields_if_needed_for_bool (ref=0x14978802e638, thd=0x149788000db8, this=0x14978802e340) at /data/10.5_dbg/sql/item.h:996
#21 Item_cond::fix_fields (this=0x14978802e528, thd=0x149788000db8, ref=<optimized out>) at /data/10.5_dbg/sql/item_cmpfunc.cc:4901
#22 0x000055d9fd393241 in Item::fix_fields_if_needed (ref=0x14978802e648, thd=0x149788000db8, this=0x14978802e528) at /data/10.5_dbg/sql/sql_list.h:199
#23 Item::fix_fields_if_needed_for_scalar (ref=0x14978802e648, thd=0x149788000db8, this=0x14978802e528) at /data/10.5_dbg/sql/item.h:992
#26 0x000055d9fd7fbfd4 in subselect_single_select_engine::prepare (this=0x14978802e870, thd=0x149788000db8) at /data/10.5_dbg/sql/sql_lex.h:1352
#27 0x000055d9fd7fb11a in Item_subselect::fix_fields (this=0x14978802e6c8, thd_param=<optimized out>, ref=0x1497880375d0) at /data/10.5_dbg/sql/item_subselect.cc:289
#28 0x000055d9fd74007c in Item::fix_fields_if_needed (ref=0x1497880375d0, thd=0x149788000db8, this=0x14978802e6c8) at /data/10.5_dbg/sql/item.h:996
#29 Item::fix_fields_if_needed_for_scalar (ref=0x1497880375d0, thd=0x149788000db8, this=0x14978802e6c8) at /data/10.5_dbg/sql/item.h:992
#30 Item::fix_fields_if_needed_for_bool (ref=0x1497880375d0, thd=0x149788000db8, this=0x14978802e6c8) at /data/10.5_dbg/sql/item.h:996
#31 Item_cond::fix_fields (this=0x1497880374a8, thd=0x149788000db8, ref=<optimized out>) at /data/10.5_dbg/sql/item_cmpfunc.cc:4901
#32 0x000055d9fd74007c in Item::fix_fields_if_needed (ref=0x14978803a760, thd=0x149788000db8, this=0x1497880374a8) at /data/10.5_dbg/sql/item.h:996
#33 Item::fix_fields_if_needed_for_scalar (ref=0x14978803a760, thd=0x149788000db8, this=0x1497880374a8) at /data/10.5_dbg/sql/item.h:992
#34 Item::fix_fields_if_needed_for_bool (ref=0x14978803a760, thd=0x149788000db8, this=0x1497880374a8) at /data/10.5_dbg/sql/item.h:996
#35 Item_cond::fix_fields (this=0x14978803a660, thd=0x149788000db8, ref=<optimized out>) at /data/10.5_dbg/sql/item_cmpfunc.cc:4901
#36 0x000055d9fd393241 in Item::fix_fields_if_needed (ref=0x14978803a9b8, thd=0x149788000db8, this=0x14978803a660) at /data/10.5_dbg/sql/sql_list.h:199
#37 Item::fix_fields_if_needed_for_scalar (ref=0x14978803a9b8, thd=0x149788000db8, this=0x14978803a660) at /data/10.5_dbg/sql/item.h:992
#39 0x000055d9fd489e37 in JOIN::prepare (this=this@entry=0x1497880c1f28, tables_init=tables_init@entry=0x0, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=order_init@entry=0x0, skip_order_by=skip_order_by@entry=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x149788029d88, unit_arg=0x14978802a9a8) at /data/10.5_dbg/sql/sql_select.cc:1243
#40 0x000055d9fd4a2fed in mysql_select (thd=thd@entry=0x149788000db8, tables=0x0, fields=@0x149788029ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14978803a9b0, last = 0x14978803a9b0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x1497880c1f00, unit=0x14978802a9a8, select_lex=0x149788029d88) at /data/10.5_dbg/sql/sql_select.cc:4699
#41 0x000055d9fd4a3325 in handle_select (thd=thd@entry=0x149788000db8, lex=lex@entry=0x14978802a8e0, result=result@entry=0x1497880c1f00, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/10.5_dbg/sql/sql_select.cc:417
#42 0x000055d9fd415337 in execute_sqlcom_select (thd=thd@entry=0x149788000db8, all_tables=0x14978802db80) at /data/10.5_dbg/sql/sql_parse.cc:6307
#43 0x000055d9fd42257e in mysql_execute_command (thd=0x149788000db8) at /data/10.5_dbg/sql/sql_parse.cc:4003
#44 0x000055d9fd33ddfd in sp_instr_stmt::exec_core (this=0x14978803a9e0, thd=<optimized out>, nextp=0x1497d40ca1cc) at /data/10.5_dbg/sql/sp_head.cc:3768
#45 0x000055d9fd34b570 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x14978803aa28, thd=thd@entry=0x149788000db8, nextp=nextp@entry=0x1497d40ca1cc, open_tables=open_tables@entry=false, instr=instr@entry=0x14978803a9e0) at /data/10.5_dbg/sql/sp_head.cc:3495
#46 0x000055d9fd34c13d in sp_instr_stmt::execute (this=0x14978803a9e0, thd=0x149788000db8, nextp=0x1497d40ca1cc) at /data/10.5_dbg/sql/sp_head.cc:3674
#47 0x000055d9fd343d55 in sp_head::execute (this=this@entry=0x149788028830, thd=thd@entry=0x149788000db8, merge_da_on_success=merge_da_on_success@entry=true) at /data/10.5_dbg/sql/sp_head.cc:1437
#48 0x000055d9fd345e00 in sp_head::execute_procedure (this=0x149788028830, thd=thd@entry=0x149788000db8, args=0x149788005e48) at /data/10.5_dbg/sql/sp_head.cc:2449
#49 0x000055d9fd414cd9 in do_execute_sp (thd=thd@entry=0x149788000db8, sp=sp@entry=0x149788028830) at /data/10.5_dbg/sql/sql_parse.cc:3088
#50 0x000055d9fd41a814 in Sql_cmd_call::execute (this=0x149788013d90, thd=0x149788000db8) at /data/10.5_dbg/sql/sql_parse.cc:3334
#51 0x000055d9fd428184 in mysql_execute_command (thd=thd@entry=0x149788000db8) at /data/10.5_dbg/sql/sql_parse.cc:6049
#52 0x000055d9fd40e1b3 in mysql_parse (thd=thd@entry=0x149788000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1497d40cb3d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/10.5_dbg/sql/sql_parse.cc:8093
#53 0x000055d9fd41d350 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149788000db8, packet=packet@entry=0x14978800b499 "CALL p (@b,@c)", packet_length=packet_length@entry=14, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/10.5_dbg/sql/sql_class.h:1270
#54 0x000055d9fd420ab1 in do_command (thd=0x149788000db8) at /data/10.5_dbg/sql/sql_parse.cc:1370
#55 0x000055d9fd57c201 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55da01648e68, put_in_cache=put_in_cache@entry=true) at /data/10.5_dbg/sql/sql_connect.cc:1410
#56 0x000055d9fd57c905 in handle_one_connection (arg=arg@entry=0x55da01648e68) at /data/10.5_dbg/sql/sql_connect.cc:1312
#57 0x000055d9fda3319f in pfs_spawn_thread (arg=0x55da01591518) at /data/10.5_dbg/storage/perfschema/pfs.cc:2201
#58 0x00001497d8198609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#59 0x00001497d7d87293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
[Current thread is 1 (Thread 0x150aac063700 (LWP 384411))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1 0x000055ecd6e3c1f1 in my_write_core (sig=sig@entry=11) at /data/builds/5.5_dbg/mysys/stacktrace.c:433
#2 0x000055ecd6cf9e1e in handle_fatal_signal (sig=11) at /data/builds/5.5_dbg/sql/signal_handler.cc:247
#3 <signal handler called>
#4 0x000055ecd6c6c2e9 in Field_iterator_table_ref::get_or_create_column_ref (this=this@entry=0x150aac05fb30, thd=thd@entry=0x55ecd8f07bf0, parent_table_ref=parent_table_ref@entry=0x0) at /data/builds/5.5_dbg/sql/table.cc:4704
#5 0x000055ecd6b8a6bd in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x150a90022e38, table_ref_2=0x150a90030ad0, table_ref_1=0x150a90030568, thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_base.cc:7254
#6 store_top_level_join_columns (thd=thd@entry=0x55ecd8f07bf0, table_ref=table_ref@entry=0x150a90031008, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /data/builds/5.5_dbg/sql/sql_base.cc:7673
#7 0x000055ecd6b91f15 in setup_natural_join_row_types (context=0x150a90021c68, from_clause=0x150a90021d88, thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_base.cc:7779
#8 setup_tables (thd=thd@entry=0x55ecd8f07bf0, context=0x150a90021c68, from_clause=0x150a90021d88, tables=tables@entry=0x150a90022838, leaves=leaves@entry=0x150aac05fd50, select_insert=select_insert@entry=false) at /data/builds/5.5_dbg/sql/sql_base.cc:8101
#9 0x000055ecd6b9201d in setup_tables_and_check_access (thd=0x55ecd8f07bf0, context=<optimized out>, from_clause=<optimized out>, tables=0x150a90022838, leaves=0x150a90021db0, select_insert=select_insert@entry=false, want_access_first=1, want_access=1) at /data/builds/5.5_dbg/sql/sql_base.cc:8143
#10 0x000055ecd6c1138f in JOIN::prepare (this=this@entry=0x150a90034178, rref_pointer_array=rref_pointer_array@entry=0x150a90021e00, tables_init=tables_init@entry=0x150a90022838, wild_num=wild_num@entry=1, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=0x0, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x150a90021c18, unit_arg=0x150a900215f8) at /data/builds/5.5_dbg/sql/sql_select.cc:511
#11 0x000055ecd6c1be3b in mysql_select (thd=thd@entry=0x55ecd8f07bf0, rref_pointer_array=rref_pointer_array@entry=0x150a90021e00, tables=0x150a90022838, wild_num=1, fields=@0x150a90021d28: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150a900227f0, last = 0x150a900227f0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x150a90034158, unit=0x150a900215f8, select_lex=0x150a90021c18) at /data/builds/5.5_dbg/sql/sql_select.cc:2596
#12 0x000055ecd6c1c0df in handle_select (thd=thd@entry=0x55ecd8f07bf0, lex=lex@entry=0x150a90021548, result=result@entry=0x150a90034158, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/5.5_dbg/sql/sql_select.cc:285
#13 0x000055ecd6bcf26c in execute_sqlcom_select (thd=thd@entry=0x55ecd8f07bf0, all_tables=0x150a90022838) at /data/builds/5.5_dbg/sql/sql_parse.cc:4676
#14 0x000055ecd6bd635a in mysql_execute_command (thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_parse.cc:2213
#15 0x000055ecd6dd7b6d in sp_instr_stmt::exec_core (this=0x150a900315a0, thd=<optimized out>, nextp=0x150aac0613b4) at /data/builds/5.5_dbg/sql/sp_head.cc:3209
#16 0x000055ecd6dde8cd in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x150a900315e0, thd=thd@entry=0x55ecd8f07bf0, nextp=nextp@entry=0x150aac0613b4, open_tables=open_tables@entry=false, instr=instr@entry=0x150a900315a0) at /data/builds/5.5_dbg/sql/sp_head.cc:2998
#17 0x000055ecd6dded61 in sp_instr_stmt::execute (this=0x150a900315a0, thd=0x55ecd8f07bf0, nextp=0x150aac0613b4) at /data/builds/5.5_dbg/sql/sp_head.cc:3141
#18 0x000055ecd6dda60d in sp_head::execute (this=this@entry=0x150a90020e70, thd=thd@entry=0x55ecd8f07bf0, merge_da_on_success=merge_da_on_success@entry=true) at /data/builds/5.5_dbg/sql/sp_head.cc:1435
#19 0x000055ecd6ddbd2c in sp_head::execute_procedure (this=this@entry=0x150a90020e70, thd=thd@entry=0x55ecd8f07bf0, args=args@entry=0x55ecd8f0a180) at /data/builds/5.5_dbg/sql/sp_head.cc:2199
#20 0x000055ecd6bdbb38 in mysql_execute_command (thd=thd@entry=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_parse.cc:4120
#21 0x000055ecd6bddc47 in mysql_parse (thd=thd@entry=0x55ecd8f07bf0, rawbuf=<optimized out>, length=7, parser_state=parser_state@entry=0x150aac062610) at /data/builds/5.5_dbg/sql/sql_parse.cc:5831
#22 0x000055ecd6bdf4bd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x55ecd8f07bf0, packet=packet@entry=0x55ecd8f8f151 "CALL sp", packet_length=packet_length@entry=7) at /data/builds/5.5_dbg/sql/sql_class.h:758
#23 0x000055ecd6be0d83 in do_command (thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_parse.cc:776
#24 0x000055ecd6c913f2 in do_handle_one_connection (thd_arg=thd_arg@entry=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_connect.cc:870
#25 0x000055ecd6c914c4 in handle_one_connection (arg=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_connect.cc:789
#26 0x0000150aae57d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#27 0x0000150aae172293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Roel Van de Paar
added a comment - - edited MySQL 5.5 (which is the only MySQL version that crashes) stack from Elena's original testcase:
MySQL 5.5 (Debug)
Core was generated by `/test/MS260121-mysql-5.5.62-linux-x86_64-dbg/bin/mysqld --no-defaults --core --'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x150aac063700 (LWP 384411))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1 0x000055ecd6e3c1f1 in my_write_core (sig=sig@entry=11) at /data/builds/5.5_dbg/mysys/stacktrace.c:433
#2 0x000055ecd6cf9e1e in handle_fatal_signal (sig=11) at /data/builds/5.5_dbg/sql/signal_handler.cc:247
#3 <signal handler called>
#4 0x000055ecd6c6c2e9 in Field_iterator_table_ref::get_or_create_column_ref (this=this@entry=0x150aac05fb30, thd=thd@entry=0x55ecd8f07bf0, parent_table_ref=parent_table_ref@entry=0x0) at /data/builds/5.5_dbg/sql/table.cc:4704
#5 0x000055ecd6b8a6bd in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x150a90022e38, table_ref_2=0x150a90030ad0, table_ref_1=0x150a90030568, thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_base.cc:7254
#6 store_top_level_join_columns (thd=thd@entry=0x55ecd8f07bf0, table_ref=table_ref@entry=0x150a90031008, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /data/builds/5.5_dbg/sql/sql_base.cc:7673
#7 0x000055ecd6b91f15 in setup_natural_join_row_types (context=0x150a90021c68, from_clause=0x150a90021d88, thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_base.cc:7779
#8 setup_tables (thd=thd@entry=0x55ecd8f07bf0, context=0x150a90021c68, from_clause=0x150a90021d88, tables=tables@entry=0x150a90022838, leaves=leaves@entry=0x150aac05fd50, select_insert=select_insert@entry=false) at /data/builds/5.5_dbg/sql/sql_base.cc:8101
#9 0x000055ecd6b9201d in setup_tables_and_check_access (thd=0x55ecd8f07bf0, context=<optimized out>, from_clause=<optimized out>, tables=0x150a90022838, leaves=0x150a90021db0, select_insert=select_insert@entry=false, want_access_first=1, want_access=1) at /data/builds/5.5_dbg/sql/sql_base.cc:8143
#10 0x000055ecd6c1138f in JOIN::prepare (this=this@entry=0x150a90034178, rref_pointer_array=rref_pointer_array@entry=0x150a90021e00, tables_init=tables_init@entry=0x150a90022838, wild_num=wild_num@entry=1, conds_init=conds_init@entry=0x0, og_num=og_num@entry=0, order_init=0x0, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x150a90021c18, unit_arg=0x150a900215f8) at /data/builds/5.5_dbg/sql/sql_select.cc:511
#11 0x000055ecd6c1be3b in mysql_select (thd=thd@entry=0x55ecd8f07bf0, rref_pointer_array=rref_pointer_array@entry=0x150a90021e00, tables=0x150a90022838, wild_num=1, fields=@0x150a90021d28: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x150a900227f0, last = 0x150a900227f0, elements = 1}, <No data fields>}, conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x150a90034158, unit=0x150a900215f8, select_lex=0x150a90021c18) at /data/builds/5.5_dbg/sql/sql_select.cc:2596
#12 0x000055ecd6c1c0df in handle_select (thd=thd@entry=0x55ecd8f07bf0, lex=lex@entry=0x150a90021548, result=result@entry=0x150a90034158, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/5.5_dbg/sql/sql_select.cc:285
#13 0x000055ecd6bcf26c in execute_sqlcom_select (thd=thd@entry=0x55ecd8f07bf0, all_tables=0x150a90022838) at /data/builds/5.5_dbg/sql/sql_parse.cc:4676
#14 0x000055ecd6bd635a in mysql_execute_command (thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_parse.cc:2213
#15 0x000055ecd6dd7b6d in sp_instr_stmt::exec_core (this=0x150a900315a0, thd=<optimized out>, nextp=0x150aac0613b4) at /data/builds/5.5_dbg/sql/sp_head.cc:3209
#16 0x000055ecd6dde8cd in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x150a900315e0, thd=thd@entry=0x55ecd8f07bf0, nextp=nextp@entry=0x150aac0613b4, open_tables=open_tables@entry=false, instr=instr@entry=0x150a900315a0) at /data/builds/5.5_dbg/sql/sp_head.cc:2998
#17 0x000055ecd6dded61 in sp_instr_stmt::execute (this=0x150a900315a0, thd=0x55ecd8f07bf0, nextp=0x150aac0613b4) at /data/builds/5.5_dbg/sql/sp_head.cc:3141
#18 0x000055ecd6dda60d in sp_head::execute (this=this@entry=0x150a90020e70, thd=thd@entry=0x55ecd8f07bf0, merge_da_on_success=merge_da_on_success@entry=true) at /data/builds/5.5_dbg/sql/sp_head.cc:1435
#19 0x000055ecd6ddbd2c in sp_head::execute_procedure (this=this@entry=0x150a90020e70, thd=thd@entry=0x55ecd8f07bf0, args=args@entry=0x55ecd8f0a180) at /data/builds/5.5_dbg/sql/sp_head.cc:2199
#20 0x000055ecd6bdbb38 in mysql_execute_command (thd=thd@entry=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_parse.cc:4120
#21 0x000055ecd6bddc47 in mysql_parse (thd=thd@entry=0x55ecd8f07bf0, rawbuf=<optimized out>, length=7, parser_state=parser_state@entry=0x150aac062610) at /data/builds/5.5_dbg/sql/sql_parse.cc:5831
#22 0x000055ecd6bdf4bd in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x55ecd8f07bf0, packet=packet@entry=0x55ecd8f8f151 "CALL sp", packet_length=packet_length@entry=7) at /data/builds/5.5_dbg/sql/sql_class.h:758
#23 0x000055ecd6be0d83 in do_command (thd=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_parse.cc:776
#24 0x000055ecd6c913f2 in do_handle_one_connection (thd_arg=thd_arg@entry=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_connect.cc:870
#25 0x000055ecd6c914c4 in handle_one_connection (arg=0x55ecd8f07bf0) at /data/builds/5.5_dbg/sql/sql_connect.cc:789
#26 0x0000150aae57d609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#27 0x0000150aae172293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Ran into this one also
CREATE TABLE t1 (c1 INT,c2 INT);
CREATE TABLE t2 (c INT,c2 INT);
CREATE PROCEDURE p2 (OUT i INT,OUT o INT) READS SQL DATA DELETE a2,a3 FROM t1 AS a1 JOIN t2 AS a2 NATURAL JOIN t2 AS a3;
CALL p2 (@c,@a);
CALL p2 (@a,@c);
Leads to:
10.6.0 f74704c7d963ddcd1109843a5861c6bd76409c8d (Debug)
Core was generated by `/test/MD120421-mariadb-10.6.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11)
at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x14b3f4e9f700 (LWP 29453))]
(gdb) bt
#0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=11) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1 0x0000562110e82c9e in my_write_core (sig=sig@entry=11) at /test/10.6_dbg/mysys/stacktrace.c:424
#2 0x0000562110621b07 in handle_fatal_signal (sig=11) at /test/10.6_dbg/sql/signal_handler.cc:343
#3 <signal handler called>
#4 0x0000562110463042 in Field_iterator_natural_join::next (this=0x14b3f4e9c620) at /test/10.6_dbg/sql/table.cc:6876
#5 0x000056211046dd07 in Field_iterator_table_ref::next (this=this@entry=0x14b3f4e9c5d0) at /test/10.6_dbg/sql/table.cc:6946
#6 0x00005621102c6234 in mark_common_columns (found_using_fields=<synthetic pointer>, using_fields=0x0, table_ref_2=0x14b3bc02f290, table_ref_1=0x14b3bc04d270, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_base.cc:6956
#7 store_top_level_join_columns (thd=thd@entry=0x14b3bc000db8, table_ref=table_ref@entry=0x14b3bc02f960, left_neighbor=left_neighbor@entry=0x0, right_neighbor=0x0) at /test/10.6_dbg/sql/sql_base.cc:7370
#8 0x00005621102d4088 in setup_natural_join_row_types (context=0x14b3bc02cda0, from_clause=0x14b3bc02cf10, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_base.cc:7492
#9 setup_tables (thd=thd@entry=0x14b3bc000db8, context=context@entry=0x14b3bc02cda0, from_clause=from_clause@entry=0x14b3bc02cf10, tables=tables@entry=0x14b3bc02e4f0, leaves=@0x14b3bc02cf88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3bc0a82e8, last = 0x14b3bc0a8308, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7912
#10 0x00005621102d4266 in setup_tables_and_check_access (thd=thd@entry=0x14b3bc000db8, context=0x14b3bc02cda0, from_clause=0x14b3bc02cf10, tables=0x14b3bc02e4f0, leaves=@0x14b3bc02cf88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14b3bc0a82e8, last = 0x14b3bc0a8308, elements = 3}, <No data fields>}, select_insert=select_insert@entry=false, want_access_first=DELETE_ACL, want_access=SELECT_ACL, full_table_list=false) at /test/10.6_dbg/sql/sql_base.cc:7954
#11 0x000056211081bdba in mysql_multi_delete_prepare (thd=thd@entry=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_lex.h:3160
#12 0x0000562110362f08 in mysql_execute_command (thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:4831
#13 0x000056211027f597 in sp_instr_stmt::exec_core (this=0x14b3bc02e030, thd=<optimized out>, nextp=0x14b3f4e9d24c) at /test/10.6_dbg/sql/sp_head.cc:3770
#14 0x000056211028ccd2 in sp_lex_keeper::reset_lex_and_exec_core (this=this@entry=0x14b3bc02e078, thd=thd@entry=0x14b3bc000db8, nextp=nextp@entry=0x14b3f4e9d24c, open_tables=open_tables@entry=false, instr=instr@entry=0x14b3bc02e030) at /test/10.6_dbg/sql/sp_head.cc:3497
#15 0x000056211028d867 in sp_instr_stmt::execute (this=0x14b3bc02e030, thd=0x14b3bc000db8, nextp=0x14b3f4e9d24c) at /test/10.6_dbg/sql/sp_head.cc:3676
#16 0x00005621102854e7 in sp_head::execute (this=this@entry=0x14b3bc027960, thd=thd@entry=0x14b3bc000db8, merge_da_on_success=merge_da_on_success@entry=true) at /test/10.6_dbg/sql/sp_head.cc:1437
#17 0x0000562110287562 in sp_head::execute_procedure (this=0x14b3bc027960, thd=thd@entry=0x14b3bc000db8, args=0x14b3bc005e78) at /test/10.6_dbg/sql/sp_head.cc:2451
#18 0x00005621103531b4 in do_execute_sp (thd=thd@entry=0x14b3bc000db8, sp=sp@entry=0x14b3bc027960) at /test/10.6_dbg/sql/sql_parse.cc:3007
#19 0x0000562110358bee in Sql_cmd_call::execute (this=0x14b3bc013c60, thd=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:3253
#20 0x000056211036620d in mysql_execute_command (thd=thd@entry=0x14b3bc000db8) at /test/10.6_dbg/sql/sql_parse.cc:5973
#21 0x000056211034ca02 in mysql_parse (thd=thd@entry=0x14b3bc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14b3f4e9e410) at /test/10.6_dbg/sql/sql_parse.cc:8004
#22 0x000056211035b726 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14b3bc000db8, packet=packet@entry=0x14b3bc00b369 "CALL p2 (@a,@c)", packet_length=packet_length@entry=15, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
#23 0x000056211035eac7 in do_command (thd=0x14b3bc000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1399
#24 0x00005621104b8176 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562113825538, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
#25 0x00005621104b877b in handle_one_connection (arg=arg@entry=0x562113825538) at /test/10.6_dbg/sql/sql_connect.cc:1312
#26 0x0000562110966253 in pfs_spawn_thread (arg=0x562113749b48) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
#27 0x000014b40a22e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#28 0x000014b409e1d293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Bug confirmed present in:
MariaDB: 10.2.38 (dbg), 10.3.29 (dbg), 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.2.38 (opt), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)