Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14686

Server crashes in Item_field::used_tables on 2nd call of SP

Details

    Description

      --source include/have_innodb.inc
       
      CREATE OR REPLACE TABLE t1 (i1 INT, i2 INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
      CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE i2 IN (SELECT i1 FROM t1);
      CALL pr;
      CALL pr;
       
      # Cleanup
      DROP PROCEDURE pr;
      DROP TABLE t1;
      

      bb-10.3-temporal 2ae2876a6ce4

      #3  <signal handler called>
      #4  0x0000555ee223e995 in Item_field::used_tables (this=0x7f546c09c438) at /data/src/bb-10.3-temporal/sql/item.cc:3484
      #5  0x0000555ee20f7c7f in optimize_semijoin_nests (join=0x7f546c03cf58, all_table_map=3) at /data/src/bb-10.3-temporal/sql/opt_subselect.cc:2355
      #6  0x0000555ee1f8e304 in make_join_statistics (join=0x7f546c03cf58, tables_list=..., keyuse_array=0x7f546c03d248) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4993
      #7  0x0000555ee1f83497 in JOIN::optimize_inner (this=0x7f546c03cf58) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1964
      #8  0x0000555ee1f81d62 in JOIN::optimize (this=0x7f546c03cf58) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1549
      #9  0x0000555ee1f8b4be in mysql_select (thd=0x7f546c000b00, tables=0x7f546c09b8a8, wild_num=0, fields=..., conds=0x7f546c03ccf8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x7f546c03cf38, unit=0x7f546c09cbd0, select_lex=0x7f546c09d330) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4237
      #10 0x0000555ee1f7d56c in handle_select (thd=0x7f546c000b00, lex=0x7f546c09cb08, result=0x7f546c03cf38, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:380
      #11 0x0000555ee1f4878f in execute_sqlcom_select (thd=0x7f546c000b00, all_tables=0x7f546c09b8a8) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6532
      #12 0x0000555ee1f3edf6 in mysql_execute_command (thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
      #13 0x0000555ee23b06fc in sp_instr_stmt::exec_core (this=0x7f546c09c7e8, thd=0x7f546c000b00, nextp=0x7f54c0095754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3407
      #14 0x0000555ee23afb1e in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f546c09c838, thd=0x7f546c000b00, nextp=0x7f54c0095754, open_tables=false, instr=0x7f546c09c7e8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3123
      #15 0x0000555ee23b02bc in sp_instr_stmt::execute (this=0x7f546c09c7e8, thd=0x7f546c000b00, nextp=0x7f54c0095754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3310
      #16 0x0000555ee23aa401 in sp_head::execute (this=0x7f546c09aa68, thd=0x7f546c000b00, merge_da_on_success=true) at /data/src/bb-10.3-temporal/sql/sp_head.cc:1220
      #17 0x0000555ee23aca81 in sp_head::execute_procedure (this=0x7f546c09aa68, thd=0x7f546c000b00, args=0x7f546c0055f8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:2101
      #18 0x0000555ee1f3c7dd in do_execute_sp (thd=0x7f546c000b00, sp=0x7f546c09aa68) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:2919
      #19 0x0000555ee1f3d343 in Sql_cmd_call::execute (this=0x7f546c014d00, thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3161
      #20 0x0000555ee1f475a5 in mysql_execute_command (thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6258
      #21 0x0000555ee1f4c0e4 in mysql_parse (thd=0x7f546c000b00, rawbuf=0x7f546c014c48 "CALL pr", length=7, parser_state=0x7f54c00975f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7988
      #22 0x0000555ee1f398a7 in dispatch_command (command=COM_QUERY, thd=0x7f546c000b00, packet=0x7f546c1611f1 "CALL pr", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1826
      #23 0x0000555ee1f382db in do_command (thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1371
      #24 0x0000555ee209eada in do_handle_one_connection (connect=0x555ee4e527a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
      #25 0x0000555ee209e867 in handle_one_connection (arg=0x555ee4e527a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
      #26 0x0000555ee2534cfc in pfs_spawn_thread (arg=0x555ee4e76f10) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
      #27 0x00007f54cef9b494 in start_thread (arg=0x7f54c0098700) at pthread_create.c:333
      #28 0x00007f54cd38193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Does not crash without versioning.

      Attachments

        Activity

          elenst Elena Stepanova created issue -
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Description {code:sql}
          --source include/have_innodb.inc

          CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
          CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE sys_trx_end IN (SELECT sys_trx_start FROM t1);
          CALL pr;
          CALL pr;

          # Cleanup
          DROP PROCEDURE pr;
          DROP TABLE t1;
          {code}

          {noformat:title=bb-10.3-temporal 2ae2876a6ce4}
          #3 <signal handler called>
          #4 0x0000561a498ed995 in Item_field::used_tables (this=0x7fb8a006f690) at /data/src/bb-10.3-temporal/sql/item.cc:3484
          #5 0x0000561a497a6c7f in optimize_semijoin_nests (join=0x7fb8a003c630, all_table_map=3) at /data/src/bb-10.3-temporal/sql/opt_subselect.cc:2355
          #6 0x0000561a4963d304 in make_join_statistics (join=0x7fb8a003c630, tables_list=..., keyuse_array=0x7fb8a003c920) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4993
          #7 0x0000561a49632497 in JOIN::optimize_inner (this=0x7fb8a003c630) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1964
          #8 0x0000561a49630d62 in JOIN::optimize (this=0x7fb8a003c630) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1549
          #9 0x0000561a4963a4be in mysql_select (thd=0x7fb8a0000b00, tables=0x7fb8a006eab0, wild_num=0, fields=..., conds=0x7fb8a003c3d0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x7fb8a003c610, unit=0x7fb8a006fd60, select_lex=0x7fb8a00704c0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4237
          #10 0x0000561a4962c56c in handle_select (thd=0x7fb8a0000b00, lex=0x7fb8a006fc98, result=0x7fb8a003c610, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:380
          #11 0x0000561a495f778f in execute_sqlcom_select (thd=0x7fb8a0000b00, all_tables=0x7fb8a006eab0) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6532
          #12 0x0000561a495eddf6 in mysql_execute_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
          #13 0x0000561a49a5f6fc in sp_instr_stmt::exec_core (this=0x7fb8a006fa40, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3407
          #14 0x0000561a49a5eb1e in sp_lex_keeper::reset_lex_and_exec_core (this=0x7fb8a006fa90, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754, open_tables=false, instr=0x7fb8a006fa40) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3123
          #15 0x0000561a49a5f2bc in sp_instr_stmt::execute (this=0x7fb8a006fa40, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3310
          #16 0x0000561a49a59401 in sp_head::execute (this=0x7fb8a006dbf8, thd=0x7fb8a0000b00, merge_da_on_success=true) at /data/src/bb-10.3-temporal/sql/sp_head.cc:1220
          #17 0x0000561a49a5ba81 in sp_head::execute_procedure (this=0x7fb8a006dbf8, thd=0x7fb8a0000b00, args=0x7fb8a00055f8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:2101
          #18 0x0000561a495eb7dd in do_execute_sp (thd=0x7fb8a0000b00, sp=0x7fb8a006dbf8) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:2919
          #19 0x0000561a495ec343 in Sql_cmd_call::execute (this=0x7fb8a0014d00, thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3161
          #20 0x0000561a495f65a5 in mysql_execute_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6258
          #21 0x0000561a495fb0e4 in mysql_parse (thd=0x7fb8a0000b00, rawbuf=0x7fb8a0014c48 "CALL pr", length=7, parser_state=0x7fb8f058f5f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7988
          #22 0x0000561a495e88a7 in dispatch_command (command=COM_QUERY, thd=0x7fb8a0000b00, packet=0x7fb8a01611f1 "CALL pr", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1826
          #23 0x0000561a495e72db in do_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1371
          #24 0x0000561a4974dada in do_handle_one_connection (connect=0x561a4c6537a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
          #25 0x0000561a4974d867 in handle_one_connection (arg=0x561a4c6537a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
          #26 0x0000561a49be3cfc in pfs_spawn_thread (arg=0x561a4c677f10) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
          #27 0x00007fb8ff695494 in start_thread (arg=0x7fb8f0590700) at pthread_create.c:333
          #28 0x00007fb8fda7b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}
          {code:sql}
          --source include/have_innodb.inc

          CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
          CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE sys_trx_end IN (SELECT sys_trx_start FROM t1);
          CALL pr;
          CALL pr;

          # Cleanup
          DROP PROCEDURE pr;
          DROP TABLE t1;
          {code}

          {noformat:title=bb-10.3-temporal 2ae2876a6ce4}
          #3 <signal handler called>
          #4 0x0000561a498ed995 in Item_field::used_tables (this=0x7fb8a006f690) at /data/src/bb-10.3-temporal/sql/item.cc:3484
          #5 0x0000561a497a6c7f in optimize_semijoin_nests (join=0x7fb8a003c630, all_table_map=3) at /data/src/bb-10.3-temporal/sql/opt_subselect.cc:2355
          #6 0x0000561a4963d304 in make_join_statistics (join=0x7fb8a003c630, tables_list=..., keyuse_array=0x7fb8a003c920) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4993
          #7 0x0000561a49632497 in JOIN::optimize_inner (this=0x7fb8a003c630) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1964
          #8 0x0000561a49630d62 in JOIN::optimize (this=0x7fb8a003c630) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1549
          #9 0x0000561a4963a4be in mysql_select (thd=0x7fb8a0000b00, tables=0x7fb8a006eab0, wild_num=0, fields=..., conds=0x7fb8a003c3d0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x7fb8a003c610, unit=0x7fb8a006fd60, select_lex=0x7fb8a00704c0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4237
          #10 0x0000561a4962c56c in handle_select (thd=0x7fb8a0000b00, lex=0x7fb8a006fc98, result=0x7fb8a003c610, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:380
          #11 0x0000561a495f778f in execute_sqlcom_select (thd=0x7fb8a0000b00, all_tables=0x7fb8a006eab0) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6532
          #12 0x0000561a495eddf6 in mysql_execute_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
          #13 0x0000561a49a5f6fc in sp_instr_stmt::exec_core (this=0x7fb8a006fa40, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3407
          #14 0x0000561a49a5eb1e in sp_lex_keeper::reset_lex_and_exec_core (this=0x7fb8a006fa90, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754, open_tables=false, instr=0x7fb8a006fa40) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3123
          #15 0x0000561a49a5f2bc in sp_instr_stmt::execute (this=0x7fb8a006fa40, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3310
          #16 0x0000561a49a59401 in sp_head::execute (this=0x7fb8a006dbf8, thd=0x7fb8a0000b00, merge_da_on_success=true) at /data/src/bb-10.3-temporal/sql/sp_head.cc:1220
          #17 0x0000561a49a5ba81 in sp_head::execute_procedure (this=0x7fb8a006dbf8, thd=0x7fb8a0000b00, args=0x7fb8a00055f8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:2101
          #18 0x0000561a495eb7dd in do_execute_sp (thd=0x7fb8a0000b00, sp=0x7fb8a006dbf8) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:2919
          #19 0x0000561a495ec343 in Sql_cmd_call::execute (this=0x7fb8a0014d00, thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3161
          #20 0x0000561a495f65a5 in mysql_execute_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6258
          #21 0x0000561a495fb0e4 in mysql_parse (thd=0x7fb8a0000b00, rawbuf=0x7fb8a0014c48 "CALL pr", length=7, parser_state=0x7fb8f058f5f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7988
          #22 0x0000561a495e88a7 in dispatch_command (command=COM_QUERY, thd=0x7fb8a0000b00, packet=0x7fb8a01611f1 "CALL pr", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1826
          #23 0x0000561a495e72db in do_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1371
          #24 0x0000561a4974dada in do_handle_one_connection (connect=0x561a4c6537a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
          #25 0x0000561a4974d867 in handle_one_connection (arg=0x561a4c6537a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
          #26 0x0000561a49be3cfc in pfs_spawn_thread (arg=0x561a4c677f10) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
          #27 0x00007fb8ff695494 in start_thread (arg=0x7fb8f0590700) at pthread_create.c:333
          #28 0x00007fb8fda7b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}

          Here is another test case, which doesn't touch system versioning fields. However, it still crashes only on a versioned table:
          {code:sql}
          --source include/have_innodb.inc

          CREATE OR REPLACE TABLE t1 (i1 INT, i2 INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
          CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE i2 IN (SELECT i1 FROM t1);
          CALL pr;
          CALL pr;

          # Cleanup
          DROP PROCEDURE pr;
          DROP TABLE t1;
          {code}
          Summary Server crashes in Item_field::used_tables on 2nd call of SP which selects system versioning fields Server crashes in Item_field::used_tables on 2nd call of SP
          elenst Elena Stepanova made changes -
          Description {code:sql}
          --source include/have_innodb.inc

          CREATE OR REPLACE TABLE t1 (i INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
          CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE sys_trx_end IN (SELECT sys_trx_start FROM t1);
          CALL pr;
          CALL pr;

          # Cleanup
          DROP PROCEDURE pr;
          DROP TABLE t1;
          {code}

          {noformat:title=bb-10.3-temporal 2ae2876a6ce4}
          #3 <signal handler called>
          #4 0x0000561a498ed995 in Item_field::used_tables (this=0x7fb8a006f690) at /data/src/bb-10.3-temporal/sql/item.cc:3484
          #5 0x0000561a497a6c7f in optimize_semijoin_nests (join=0x7fb8a003c630, all_table_map=3) at /data/src/bb-10.3-temporal/sql/opt_subselect.cc:2355
          #6 0x0000561a4963d304 in make_join_statistics (join=0x7fb8a003c630, tables_list=..., keyuse_array=0x7fb8a003c920) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4993
          #7 0x0000561a49632497 in JOIN::optimize_inner (this=0x7fb8a003c630) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1964
          #8 0x0000561a49630d62 in JOIN::optimize (this=0x7fb8a003c630) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1549
          #9 0x0000561a4963a4be in mysql_select (thd=0x7fb8a0000b00, tables=0x7fb8a006eab0, wild_num=0, fields=..., conds=0x7fb8a003c3d0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x7fb8a003c610, unit=0x7fb8a006fd60, select_lex=0x7fb8a00704c0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4237
          #10 0x0000561a4962c56c in handle_select (thd=0x7fb8a0000b00, lex=0x7fb8a006fc98, result=0x7fb8a003c610, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:380
          #11 0x0000561a495f778f in execute_sqlcom_select (thd=0x7fb8a0000b00, all_tables=0x7fb8a006eab0) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6532
          #12 0x0000561a495eddf6 in mysql_execute_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
          #13 0x0000561a49a5f6fc in sp_instr_stmt::exec_core (this=0x7fb8a006fa40, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3407
          #14 0x0000561a49a5eb1e in sp_lex_keeper::reset_lex_and_exec_core (this=0x7fb8a006fa90, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754, open_tables=false, instr=0x7fb8a006fa40) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3123
          #15 0x0000561a49a5f2bc in sp_instr_stmt::execute (this=0x7fb8a006fa40, thd=0x7fb8a0000b00, nextp=0x7fb8f058d754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3310
          #16 0x0000561a49a59401 in sp_head::execute (this=0x7fb8a006dbf8, thd=0x7fb8a0000b00, merge_da_on_success=true) at /data/src/bb-10.3-temporal/sql/sp_head.cc:1220
          #17 0x0000561a49a5ba81 in sp_head::execute_procedure (this=0x7fb8a006dbf8, thd=0x7fb8a0000b00, args=0x7fb8a00055f8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:2101
          #18 0x0000561a495eb7dd in do_execute_sp (thd=0x7fb8a0000b00, sp=0x7fb8a006dbf8) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:2919
          #19 0x0000561a495ec343 in Sql_cmd_call::execute (this=0x7fb8a0014d00, thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3161
          #20 0x0000561a495f65a5 in mysql_execute_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6258
          #21 0x0000561a495fb0e4 in mysql_parse (thd=0x7fb8a0000b00, rawbuf=0x7fb8a0014c48 "CALL pr", length=7, parser_state=0x7fb8f058f5f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7988
          #22 0x0000561a495e88a7 in dispatch_command (command=COM_QUERY, thd=0x7fb8a0000b00, packet=0x7fb8a01611f1 "CALL pr", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1826
          #23 0x0000561a495e72db in do_command (thd=0x7fb8a0000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1371
          #24 0x0000561a4974dada in do_handle_one_connection (connect=0x561a4c6537a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
          #25 0x0000561a4974d867 in handle_one_connection (arg=0x561a4c6537a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
          #26 0x0000561a49be3cfc in pfs_spawn_thread (arg=0x561a4c677f10) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
          #27 0x00007fb8ff695494 in start_thread (arg=0x7fb8f0590700) at pthread_create.c:333
          #28 0x00007fb8fda7b93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}

          Here is another test case, which doesn't touch system versioning fields. However, it still crashes only on a versioned table:
          {code:sql}
          --source include/have_innodb.inc

          CREATE OR REPLACE TABLE t1 (i1 INT, i2 INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
          CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE i2 IN (SELECT i1 FROM t1);
          CALL pr;
          CALL pr;

          # Cleanup
          DROP PROCEDURE pr;
          DROP TABLE t1;
          {code}
          {code:sql}
          --source include/have_innodb.inc

          CREATE OR REPLACE TABLE t1 (i1 INT, i2 INT) ENGINE=InnoDB WITH SYSTEM VERSIONING;
          CREATE OR REPLACE PROCEDURE pr() SELECT * from t1 WHERE i2 IN (SELECT i1 FROM t1);
          CALL pr;
          CALL pr;

          # Cleanup
          DROP PROCEDURE pr;
          DROP TABLE t1;
          {code}

          {noformat:title=bb-10.3-temporal 2ae2876a6ce4}
          #3 <signal handler called>
          #4 0x0000555ee223e995 in Item_field::used_tables (this=0x7f546c09c438) at /data/src/bb-10.3-temporal/sql/item.cc:3484
          #5 0x0000555ee20f7c7f in optimize_semijoin_nests (join=0x7f546c03cf58, all_table_map=3) at /data/src/bb-10.3-temporal/sql/opt_subselect.cc:2355
          #6 0x0000555ee1f8e304 in make_join_statistics (join=0x7f546c03cf58, tables_list=..., keyuse_array=0x7f546c03d248) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4993
          #7 0x0000555ee1f83497 in JOIN::optimize_inner (this=0x7f546c03cf58) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1964
          #8 0x0000555ee1f81d62 in JOIN::optimize (this=0x7f546c03cf58) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1549
          #9 0x0000555ee1f8b4be in mysql_select (thd=0x7f546c000b00, tables=0x7f546c09b8a8, wild_num=0, fields=..., conds=0x7f546c03ccf8, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2147749632, result=0x7f546c03cf38, unit=0x7f546c09cbd0, select_lex=0x7f546c09d330) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4237
          #10 0x0000555ee1f7d56c in handle_select (thd=0x7f546c000b00, lex=0x7f546c09cb08, result=0x7f546c03cf38, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:380
          #11 0x0000555ee1f4878f in execute_sqlcom_select (thd=0x7f546c000b00, all_tables=0x7f546c09b8a8) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6532
          #12 0x0000555ee1f3edf6 in mysql_execute_command (thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
          #13 0x0000555ee23b06fc in sp_instr_stmt::exec_core (this=0x7f546c09c7e8, thd=0x7f546c000b00, nextp=0x7f54c0095754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3407
          #14 0x0000555ee23afb1e in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f546c09c838, thd=0x7f546c000b00, nextp=0x7f54c0095754, open_tables=false, instr=0x7f546c09c7e8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3123
          #15 0x0000555ee23b02bc in sp_instr_stmt::execute (this=0x7f546c09c7e8, thd=0x7f546c000b00, nextp=0x7f54c0095754) at /data/src/bb-10.3-temporal/sql/sp_head.cc:3310
          #16 0x0000555ee23aa401 in sp_head::execute (this=0x7f546c09aa68, thd=0x7f546c000b00, merge_da_on_success=true) at /data/src/bb-10.3-temporal/sql/sp_head.cc:1220
          #17 0x0000555ee23aca81 in sp_head::execute_procedure (this=0x7f546c09aa68, thd=0x7f546c000b00, args=0x7f546c0055f8) at /data/src/bb-10.3-temporal/sql/sp_head.cc:2101
          #18 0x0000555ee1f3c7dd in do_execute_sp (thd=0x7f546c000b00, sp=0x7f546c09aa68) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:2919
          #19 0x0000555ee1f3d343 in Sql_cmd_call::execute (this=0x7f546c014d00, thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3161
          #20 0x0000555ee1f475a5 in mysql_execute_command (thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6258
          #21 0x0000555ee1f4c0e4 in mysql_parse (thd=0x7f546c000b00, rawbuf=0x7f546c014c48 "CALL pr", length=7, parser_state=0x7f54c00975f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7988
          #22 0x0000555ee1f398a7 in dispatch_command (command=COM_QUERY, thd=0x7f546c000b00, packet=0x7f546c1611f1 "CALL pr", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1826
          #23 0x0000555ee1f382db in do_command (thd=0x7f546c000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1371
          #24 0x0000555ee209eada in do_handle_one_connection (connect=0x555ee4e527a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
          #25 0x0000555ee209e867 in handle_one_connection (arg=0x555ee4e527a0) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
          #26 0x0000555ee2534cfc in pfs_spawn_thread (arg=0x555ee4e76f10) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
          #27 0x00007f54cef9b494 in start_thread (arg=0x7f54c0098700) at pthread_create.c:333
          #28 0x00007f54cd38193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
          {noformat}

          Does not crash without versioning.
          elenst Elena Stepanova made changes -
          Assignee Elena Stepanova [ elenst ] Aleksey Midenkov [ midenok ]
          elenst Elena Stepanova made changes -
          Assignee Aleksey Midenkov [ midenok ] Alexander Krizhanovsky [ krizhanovsky ]
          midenok Aleksey Midenkov made changes -
          Assignee Alexander Krizhanovsky [ krizhanovsky ] Aleksey Midenkov [ midenok ]
          midenok Aleksey Midenkov made changes -
          Fix Version/s 10.3.3 [ 22644 ]
          Fix Version/s 10.3 [ 22126 ]
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.3.4 [ 22904 ]
          Fix Version/s 10.3.3 [ 22644 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 84477 ] MariaDB v4 [ 153380 ]

          People

            midenok Aleksey Midenkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.