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

Rollback Issue for INSTANT ALTER DROP on tables with existing INSTANT ADD

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1(id INT PRIMARY KEY, c1 INT) ENGINE=InnoDB;
      INSERT INTO t1 VALUES(1, 100);
      INSERT INTO t1 VALUES(2, 200);
      ALTER TABLE t1 ADD COLUMN c2 VARCHAR(100) DEFAULT 'default_value', ALGORITHM=INSTANT;
      SET STATEMENT DEBUG_DBUG="+d,btr_page_alloc_fail" FOR
      ALTER TABLE t1 DROP COLUMN c2, ALGORITHM=INSTANT;
      SELECT * FROM t1;
      

      Leads to:

      CS 11.4.11 f279551013d1319f27344080e2c0758f3959cebf (Debug, Clang 18.1.3-11) Build 10/05/2026

      mariadbd: /test/11.4_dbg/storage/innobase/btr/btr0cur.cc:3415: void btr_cur_trim(dtuple_t *, const dict_index_t *, const upd_t *, const que_thr_t *): Assertion `update->n_fields > 2' failed.
      

      CS 11.4.11 f279551013d1319f27344080e2c0758f3959cebf (Debug, Clang 18.1.3-11) Build 10/05/2026

      Core was generated by `/test/MD100526-mariadb-11.4.11-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
       
      [Current thread is 1 (LWP 4161167)]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x000072f8d8e4527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000072f8d8e288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000072f8d8e2881b in __assert_fail_base (fmt=0x72f8d8fd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5fe0886d42b6 "update->n_fields > 2", file=file@entry=0x5fe0886d13fc "/test/11.4_dbg/storage/innobase/btr/btr0cur.cc", line=line@entry=3415, function=function@entry=0x5fe0886d424b "void btr_cur_trim(dtuple_t *, const dict_index_t *, const upd_t *, const que_thr_t *)") at ./assert/assert.c:96
      #6  0x000072f8d8e3b517 in __assert_fail (assertion=0x5fe0886d42b6 "update->n_fields > 2", file=0x5fe0886d13fc "/test/11.4_dbg/storage/innobase/btr/btr0cur.cc", line=3415, function=0x5fe0886d424b "void btr_cur_trim(dtuple_t *, const dict_index_t *, const upd_t *, const que_thr_t *)") at ./assert/assert.c:105
      #7  0x00005fe0880a49cd in btr_cur_trim (entry=0x6af7d8089900, index=0x6af7d8029ec0, update=0x6af7d8015940, thr=0x6af7d80278c0)at /test/11.4_dbg/storage/innobase/btr/btr0cur.cc:3415
      #8  0x00005fe0880a5b38 in btr_cur_pessimistic_update (flags=7, cursor=0x6af7d80893a0, offsets=0x72f8abebb080, offsets_heap=0x72f8abebb088, entry_heap=0x6af7d8089840, big_rec=0x72f8abebad98, update=0x6af7d8015940, cmpl_info=1, thr=0x6af7d80278c0, trx_id=34, mtr=0x72f8abebb0e0)at /test/11.4_dbg/storage/innobase/btr/btr0cur.cc:3871
      #9  0x00005fe087fe0841 in row_undo_mod_clust_low (node=0x6af7d8089330, offsets=0x72f8abebb080, offsets_heap=0x72f8abebb088, heap=0x6af7d8089840, sys=0x72f8abebb0d3 '\245' <repeats 13 times>, "\001", thr=0x6af7d80278c0, mtr=0x72f8abebb0e0, mode=BTR_MODIFY_TREE)at /test/11.4_dbg/storage/innobase/row/row0umod.cc:121
      #10 0x00005fe087fdb6db in row_undo_mod_clust (node=0x6af7d8089330, thr=0x6af7d80278c0) at /test/11.4_dbg/storage/innobase/row/row0umod.cc:292
      #11 0x00005fe087fd9ec7 in row_undo_mod (node=0x6af7d8089330, thr=0x6af7d80278c0) at /test/11.4_dbg/storage/innobase/row/row0umod.cc:1348
      #12 0x00005fe087fe35f5 in row_undo (node=0x6af7d8089330, thr=0x6af7d80278c0)at /test/11.4_dbg/storage/innobase/row/row0undo.cc:401
      #13 0x00005fe087fe32bc in row_undo_step (thr=0x6af7d80278c0)at /test/11.4_dbg/storage/innobase/row/row0undo.cc:442
      #14 0x00005fe087f0f55d in que_thr_step (thr=0x6af7d80278c0)at /test/11.4_dbg/storage/innobase/que/que0que.cc:551
      #15 0x00005fe087f0eb63 in que_run_threads_low (thr=0x6af7d80278c0)at /test/11.4_dbg/storage/innobase/que/que0que.cc:609
      #16 0x00005fe087f0e914 in que_run_threads (thr=0x6af7d80278c0)at /test/11.4_dbg/storage/innobase/que/que0que.cc:629
      #17 0x00005fe08803aeaf in trx_t::rollback_low (this=0x72f8d807a680, savept=0x0)at /test/11.4_dbg/storage/innobase/trx/trx0roll.cc:118
      #18 0x00005fe08803b84e in trx_t::rollback (this=0x72f8d807a680, savept=0x0)at /test/11.4_dbg/storage/innobase/trx/trx0roll.cc:181
      #19 0x00005fe087dddf7c in ha_innobase::commit_inplace_alter_table (this=0x6af7d802c848, altered_table=0x72f8abebd110, ha_alter_info=0x72f8abebcdc8, commit=true)at /test/11.4_dbg/storage/innobase/handler/handler0alter.cc:11631
      #20 0x00005fe0879b23e8 in handler::ha_commit_inplace_alter_table (this=0x6af7d802c848, altered_table=0x72f8abebd110, ha_alter_info=0x72f8abebcdc8, commit=true)at /test/11.4_dbg/sql/handler.cc:5662
      #21 0x00005fe0876c445d in mysql_inplace_alter_table (thd=0x6af7d8000d58, table_list=0x6af7d8019d10, table=0x6af7d8014ac8, altered_table=0x72f8abebd110, ha_alter_info=0x72f8abebcdc8, target_mdl_request=0x72f8abebefa0, ddl_log_state=0x72f8abebd080, trigger_param=0x72f8abebebb0, alter_ctx=0x72f8abebdf18, partial_alter=@0x72f8abebd06e: false, start_alter_id=@0x72f8abebd060: 0, if_exists=false) at /test/11.4_dbg/sql/sql_table.cc:8194
      #22 0x00005fe0876bc18c in mysql_alter_table (thd=0x6af7d8000d58, new_db=0x6af7d8005900, new_name=0x6af7d8005d60, create_info=0x72f8abec0020, table_list=0x6af7d8019d10, recreate_info=0x72f8abebf708, alter_info=0x72f8abebfeb0, order_num=0, order=0x0, ignore=false, if_exists=false)at /test/11.4_dbg/sql/sql_table.cc:11621
      #23 0x00005fe08777fef3 in Sql_cmd_alter_table::execute (this=0x6af7d801a458, thd=0x6af7d8000d58) at /test/11.4_dbg/sql/sql_alter.cc:703
      #24 0x00005fe08759e76e in mysql_execute_command (thd=0x6af7d8000d58, is_called_from_prepared_stmt=false) at /test/11.4_dbg/sql/sql_parse.cc:5916
      #25 0x00005fe08758d9f4 in mysql_parse (thd=0x6af7d8000d58, rawbuf=0x6af7d8019a50 "SET STATEMENT DEBUG_DBUG=\"+d,btr_page_alloc_fail\" FOR\nALTER TABLE t1 DROP COLUMN c2, ALGORITHM=INSTANT", length=102, parser_state=0x72f8abec1a30) at /test/11.4_dbg/sql/sql_parse.cc:7945
      #26 0x00005fe08758ae19 in dispatch_command (command=COM_QUERY, thd=0x6af7d8000d58, packet=0x6af7d800afa9 "SET STATEMENT DEBUG_DBUG=\"+d,btr_page_alloc_fail\" FOR\nALTER TABLE t1 DROP COLUMN c2, ALGORITHM=INSTANT", packet_length=102, blocking=true) at /test/11.4_dbg/sql/sql_parse.cc:1925
      #27 0x00005fe08758e5a3 in do_command (thd=0x6af7d8000d58, blocking=true)at /test/11.4_dbg/sql/sql_parse.cc:1433
      #28 0x00005fe087774439 in do_handle_one_connection (connect=0x5fe0a8c90008, put_in_cache=true) at /test/11.4_dbg/sql/sql_connect.cc:1497
      #29 0x00005fe0877741d2 in handle_one_connection (arg=0x5fe0a8ccd848)at /test/11.4_dbg/sql/sql_connect.cc:1409
      #30 0x000072f8d8e9caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #31 0x000072f8d8f29c6c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Bug Detection Matrix

          Rel    o/d  Build   Commit                                    UniqueID observed
      CS  10.6   dbg  100526  d37e50c6d04c7c27362f1668ae86fa592b94fb23  No bug found
      CS  10.6   opt  100526  d37e50c6d04c7c27362f1668ae86fa592b94fb23  No bug found
      CS  10.11  dbg  100526  8721a00dd38dc0aa1514a3b5ca8c95c6e94af1c9  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      CS  10.11  opt  100526  8721a00dd38dc0aa1514a3b5ca8c95c6e94af1c9  No bug found
      CS  11.4   dbg  100526  f279551013d1319f27344080e2c0758f3959cebf  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      CS  11.4   opt  100526  f279551013d1319f27344080e2c0758f3959cebf  No bug found
      CS  11.8   dbg  100526  04e09010773caf0b302b2933fff3fe95381a5e13  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      CS  11.8   opt  100526  04e09010773caf0b302b2933fff3fe95381a5e13  No bug found
      CS  12.3   dbg  100526  4c371e30f003b601e7485533476208ae27d51937  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      CS  12.3   dbg  110526  c0849d98f7ca2627ea90283b125b5b86f75b173a  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      CS  12.3   opt  100526  4c371e30f003b601e7485533476208ae27d51937  No bug found
      CS  12.3   opt  110526  c0849d98f7ca2627ea90283b125b5b86f75b173a  No bug found
      CS  13.0   dbg  100526  96b3dd0c34427e9338dda1375575a0e05a7cd267  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      CS  13.0   opt  100526  96b3dd0c34427e9338dda1375575a0e05a7cd267  No bug found
      ES  10.6   dbg  100526  55cfada6c54d1b08f2372adc1369a5e5e76f472d  No bug found
      ES  10.6   opt  100526  55cfada6c54d1b08f2372adc1369a5e5e76f472d  No bug found
      ES  11.4   dbg  100526  90f707057d44f1b5c013a0c3672fd12f32ea7085  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      ES  11.4   opt  100526  90f707057d44f1b5c013a0c3672fd12f32ea7085  No bug found
      ES  11.8   dbg  100526  d4fbd664a4514441bb3d9042c0089842ee6fc3c8  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      ES  11.8   opt  100526  d4fbd664a4514441bb3d9042c0089842ee6fc3c8  No bug found
      ES  12.3   dbg  100526  4063148254974421994024b7cc94f6f2a850177d  update->n_fields > 2|SIGABRT|btr_cur_trim|btr_cur_pessimistic_update|row_undo_mod_clust_low|row_undo_mod_clust
      ES  12.3   opt  100526  4063148254974421994024b7cc94f6f2a850177d  No bug found
      

      Attachments

        Issue Links

          Activity

            People

              tafzeel Mohammad Tafzeel Shams
              tafzeel Mohammad Tafzeel Shams
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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