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

Server crashes in in setup_on_expr upon 3rd execution of SP

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a VARCHAR(8));
      INSERT INTO t1 VALUES ('foo'),('bar');
       
      CREATE TABLE t2 (b DATE);
       
      CREATE PROCEDURE pr() INSERT INTO t2 SELECT * FROM t1;
      --error ER_TRUNCATED_WRONG_VALUE
      CALL pr;
      ALTER TABLE t1 ADD SYSTEM VERSIONING;
      --error ER_TRUNCATED_WRONG_VALUE
      CALL pr;
      --error ER_TRUNCATED_WRONG_VALUE
      CALL pr;
       
      # Cleanup
      DROP PROCEDURE pr;
      DROP TABLE t1, t2;
      

      10.3 d759f764

      #3  <signal handler called>
      #4  0x000056458a643434 in setup_on_expr (thd=0x7f8d64000af0, table=0x7f8d640731d8, is_update=true) at /data/src/10.3/sql/sql_base.cc:8094
      #5  0x000056458a6438f3 in setup_conds (thd=0x7f8d64000af0, tables=0x7f8d640731d8, leaves=..., conds=0x7f8d6403cce0) at /data/src/10.3/sql/sql_base.cc:8212
      #6  0x000056458a70e2c7 in setup_without_group (thd=0x7f8d64000af0, ref_pointer_array=..., tables=0x7f8d640731d8, leaves=..., fields=..., all_fields=..., conds=0x7f8d6403cce0, order=0x0, group=0x0, win_specs=..., win_funcs=..., hidden_group_fields=0x7f8d6403cbbf, reserved=0x7f8d64074ea4) at /data/src/10.3/sql/sql_select.cc:646
      #7  0x000056458a710b08 in JOIN::prepare (this=0x7f8d6403c8d8, tables_init=0x7f8d640731d8, wild_num=0, 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=0x7f8d64074bc8, unit_arg=0x7f8d64074440) at /data/src/10.3/sql/sql_select.cc:1143
      #8  0x000056458a71c024 in mysql_select (thd=0x7f8d64000af0, tables=0x7f8d640731d8, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=3489926912, result=0x7f8d6403c828, unit=0x7f8d64074440, select_lex=0x7f8d64074bc8) at /data/src/10.3/sql/sql_select.cc:4256
      #9  0x000056458a70d8dc in handle_select (thd=0x7f8d64000af0, lex=0x7f8d64074378, result=0x7f8d6403c828, setup_tables_done_option=1073741824) at /data/src/10.3/sql/sql_select.cc:370
      #10 0x000056458a6ce51c in mysql_execute_command (thd=0x7f8d64000af0) at /data/src/10.3/sql/sql_parse.cc:4571
      #11 0x000056458a5ee48e in sp_instr_stmt::exec_core (this=0x7f8d64073840, thd=0x7f8d64000af0, nextp=0x7f8d767cc1c4) at /data/src/10.3/sql/sp_head.cc:3592
      #12 0x000056458a5ed94c in sp_lex_keeper::reset_lex_and_exec_core (this=0x7f8d64073888, thd=0x7f8d64000af0, nextp=0x7f8d767cc1c4, open_tables=false, instr=0x7f8d64073840) at /data/src/10.3/sql/sp_head.cc:3324
      #13 0x000056458a5ee06e in sp_instr_stmt::execute (this=0x7f8d64073840, thd=0x7f8d64000af0, nextp=0x7f8d767cc1c4) at /data/src/10.3/sql/sp_head.cc:3498
      #14 0x000056458a5e7cac in sp_head::execute (this=0x7f8d64071d58, thd=0x7f8d64000af0, merge_da_on_success=true) at /data/src/10.3/sql/sp_head.cc:1356
      #15 0x000056458a5ea764 in sp_head::execute_procedure (this=0x7f8d64071d58, thd=0x7f8d64000af0, args=0x7f8d64005778) at /data/src/10.3/sql/sp_head.cc:2296
      #16 0x000056458a6c936e in do_execute_sp (thd=0x7f8d64000af0, sp=0x7f8d64071d58) at /data/src/10.3/sql/sql_parse.cc:2992
      #17 0x000056458a6c9fe4 in Sql_cmd_call::execute (this=0x7f8d640128d0, thd=0x7f8d64000af0) at /data/src/10.3/sql/sql_parse.cc:3232
      #18 0x000056458a6d3e82 in mysql_execute_command (thd=0x7f8d64000af0) at /data/src/10.3/sql/sql_parse.cc:6031
      #19 0x000056458a6d95e3 in mysql_parse (thd=0x7f8d64000af0, rawbuf=0x7f8d64012818 "CALL pr", length=7, parser_state=0x7f8d767cd5e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7818
      #20 0x000056458a6c612f in dispatch_command (command=COM_QUERY, thd=0x7f8d64000af0, packet=0x7f8d64123431 "CALL pr", packet_length=7, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #21 0x000056458a6c4a77 in do_command (thd=0x7f8d64000af0) at /data/src/10.3/sql/sql_parse.cc:1401
      #22 0x000056458a83bea8 in do_handle_one_connection (connect=0x56458e4a0a00) at /data/src/10.3/sql/sql_connect.cc:1403
      #23 0x000056458a83bc0a in handle_one_connection (arg=0x56458e4a0a00) at /data/src/10.3/sql/sql_connect.cc:1308
      #24 0x000056458b1e983c in pfs_spawn_thread (arg=0x56458e4bb9c0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #25 0x00007f8d7e1444a4 in start_thread (arg=0x7f8d767ce700) at pthread_create.c:456
      #26 0x00007f8d7c68bd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      The failure appeared recently in 10.3 branch, I didn't bisect for the exact revision.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: