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

Server crashes in prep_alter_part_table() after table lock and multiple add partition

    XMLWordPrintable

Details

    Description

      Note: The test case is similar to MDEV-14844, only here with system_time partitioning we are getting a crash, not the assertion failure.

      --source include/have_innodb.inc
      --source include/have_partition.inc
       
      CREATE OR REPLACE TABLE t1 (pk int) ENGINE=InnoDB WITH SYSTEM VERSIONING PARTITION BY system_time INTERVAL 4 HOUR (PARTITION p1 HISTORY, PARTITION pn CURRENT);
      LOCK TABLE t1 WRITE;
      SET system_versioning_alter_history=KEEP;
      --error ER_SAME_NAME_PARTITION
      ALTER TABLE t1 ADD PARTITION (PARTITION p1 HISTORY);
      SELECT * FROM t1;
       
      # Cleanup
      DROP TABLE t1;
      

      bb-10.3-temporal a3a15126f260e26b7

      #3  <signal handler called>
      #4  0x000055d50cbfecb0 in base_list_iterator::next (this=0x7f3ba42f6580) at /data/src/bb-10.3-temporal/sql/sql_list.h:412
      #5  0x000055d50cd42c39 in List_iterator<p_elem_val>::operator++ (this=0x7f3ba42f6580) at /data/src/bb-10.3-temporal/sql/sql_list.h:519
      #6  0x000055d50cdcab0c in partition_info::check_range_constants (this=0x7f3b5809d068, thd=0x7f3b58000b00, alloc=false) at /data/src/bb-10.3-temporal/sql/partition_info.cc:1552
      #7  0x000055d50d0eaf52 in partition_info::vers_update_range_constants (this=0x7f3b5809d068, thd=0x7f3b58000b00) at /data/src/bb-10.3-temporal/sql/partition_info.h:565
      #8  0x000055d50d0ceaf7 in prune_partitions (thd=0x7f3b58000b00, table=0x7f3b58072020, pprune_cond=0x7f3b580160c0) at /data/src/bb-10.3-temporal/sql/opt_range.cc:3460
      #9  0x000055d50ccd1275 in JOIN::optimize_inner (this=0x7f3b58015528) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1868
      #10 0x000055d50ccd00b8 in JOIN::optimize (this=0x7f3b58015528) at /data/src/bb-10.3-temporal/sql/sql_select.cc:1556
      #11 0x000055d50ccd9814 in mysql_select (thd=0x7f3b58000b00, tables=0x7f3b58014e30, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2149845760, result=0x7f3b58015508, unit=0x7f3b58004898, select_lex=0x7f3b58004ff0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:4244
      #12 0x000055d50cccb93e in handle_select (thd=0x7f3b58000b00, lex=0x7f3b580047d0, result=0x7f3b58015508, setup_tables_done_option=0) at /data/src/bb-10.3-temporal/sql/sql_select.cc:382
      #13 0x000055d50cc96aa1 in execute_sqlcom_select (thd=0x7f3b58000b00, all_tables=0x7f3b58014e30) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:6535
      #14 0x000055d50cc8d0e5 in mysql_execute_command (thd=0x7f3b58000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:3749
      #15 0x000055d50cc9a3f6 in mysql_parse (thd=0x7f3b58000b00, rawbuf=0x7f3b58014c48 "SELECT * FROM t1", length=16, parser_state=0x7f3ba42f85f0, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:7991
      #16 0x000055d50cc87b97 in dispatch_command (command=COM_QUERY, thd=0x7f3b58000b00, packet=0x7f3b58120201 "SELECT * FROM t1", packet_length=16, is_com_multi=false, is_next_command=false) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1825
      #17 0x000055d50cc865cb in do_command (thd=0x7f3b58000b00) at /data/src/bb-10.3-temporal/sql/sql_parse.cc:1370
      #18 0x000055d50cdee354 in do_handle_one_connection (connect=0x55d50f8cf590) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1420
      #19 0x000055d50cdee0e1 in handle_one_connection (arg=0x55d50f8cf590) at /data/src/bb-10.3-temporal/sql/sql_connect.cc:1326
      #20 0x000055d50d288c5a in pfs_spawn_thread (arg=0x55d50f915dd0) at /data/src/bb-10.3-temporal/storage/perfschema/pfs.cc:1863
      #21 0x00007f3bae3c9494 in start_thread (arg=0x7f3ba42f9700) at pthread_create.c:333
      #22 0x00007f3bac7af93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Also reproducible on tempesta-tech/mariadb 52f9f635a5fa6.

      Attachments

        Issue Links

          Activity

            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.