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

Atomic DDL: Assertion `!param->got_error' failed upon unsuccessful multi-RENAME TABLE

Details

    • Bug
    • Status: In Review (View Workflow)
    • Critical
    • Resolution: Unresolved
    • N/A
    • 12.0
    • Triggers
    • None

    Description

      While this bug and testcase look similar to MDEV-27027, this exact bug exists only in preview-12.0-preview. The same testcase (with any engine) does not create any issues on any other main branch, including trunk 12.0 as of today, and this issue is thus technically a regression in preview-12.0-preview.

      CREATE TABLE t1 (a INT);
      CREATE TRIGGER t1 AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t1 VALUES (0);
      RENAME TABLE t1 TO c,v2 TO t;
      

      Leads to:

      preview-12.0-preview CS 12.0.0 61c96785d1910976fd740aa0724105b16952786d (Debug) Build 29/03/2025

      mariadbd: /test/preview-12.0-preview_dbg/sql/sql_trigger.cc:2626: static bool Table_triggers_list::change_table_name(THD *, TRIGGER_RENAME_PARAM *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *): Assertion `!param->got_error' failed.
      

      preview-12.0-preview CS 12.0.0 61c96785d1910976fd740aa0724105b16952786d (Debug) Build 29/03/2025

      Core was generated by `/test/P12_MD290325-mariadb-12.0.0-linux-x86_64-dbg/bin/mariadbd --no-defaults -'.
      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 1026546)]
      (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  0x00007cc123e4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007cc123e288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007cc123e2881b in __assert_fail_base (fmt=0x7cc123fd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x580225ac7084 "!param->got_error", file=file@entry=0x580225ac6b1f "/test/preview-12.0-preview_dbg/sql/sql_trigger.cc", line=line@entry=2626, function=function@entry=0x580225ac7096 "static bool Table_triggers_list::change_table_name(THD *, TRIGGER_RENAME_PARAM *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *)")at ./assert/assert.c:94
      #6  0x00007cc123e3b507 in __assert_fail (assertion=0x580225ac7084 "!param->got_error", file=0x580225ac6b1f "/test/preview-12.0-preview_dbg/sql/sql_trigger.cc", line=2626, function=0x580225ac7096 "static bool Table_triggers_list::change_table_name(THD *, TRIGGER_RENAME_PARAM *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *, const LEX_CSTRING *)")at ./assert/assert.c:103
      #7  0x0000580224bb69dd in Table_triggers_list::change_table_name (thd=0x7ca234000d58, param=0x7cc117ffa9b8, db=0x7cc117ffa950, old_alias=0x7cc117ffa980, old_table=0x7cc117ffa970, new_db=0x7cc117ffa960, new_table=0x7cc117ffa990)at /test/preview-12.0-preview_dbg/sql/sql_trigger.cc:2626
      #8  0x0000580224bce8ee in rename_triggers (thd=0x7ca234000d58, ddl_log_entry=0x7cc117ffbfe0, swap_tables=false, flags=0)at /test/preview-12.0-preview_dbg/sql/ddl_log.cc:1338
      #9  0x0000580224bcb782 in ddl_log_execute_action (thd=0x7ca234000d58, mem_root=0x7cc117ffbf90, ddl_log_entry=0x7cc117ffbfe0)at /test/preview-12.0-preview_dbg/sql/ddl_log.cc:1583
      #10 0x0000580224bc7af1 in ddl_log_execute_entry_no_lock (thd=0x7ca234000d58, first_entry=1) at /test/preview-12.0-preview_dbg/sql/ddl_log.cc:2578
      #11 0x0000580224bc87b1 in ddl_log_revert (thd=0x7ca234000d58, state=0x7cc117ffc120) at /test/preview-12.0-preview_dbg/sql/ddl_log.cc:3114
      #12 0x0000580224ab7eeb in mysql_rename_tables (thd=0x7ca234000d58, table_list=0x7ca23401a0d8, silent=false, if_exists=false)at /test/preview-12.0-preview_dbg/sql/sql_rename.cc:212
      #13 0x0000580224a6b0a9 in mysql_execute_command (thd=0x7ca234000d58, is_called_from_prepared_stmt=false)at /test/preview-12.0-preview_dbg/sql/sql_parse.cc:4335
      #14 0x0000580224a61b54 in mysql_parse (thd=0x7ca234000d58, rawbuf=0x7ca234019fc0 "RENAME TABLE t1 TO c,v2 TO t", length=28, parser_state=0x7cc117ffda10)at /test/preview-12.0-preview_dbg/sql/sql_parse.cc:7889
      #15 0x0000580224a5ef28 in dispatch_command (command=COM_QUERY, thd=0x7ca234000d58, packet=0x7ca23400b339 "RENAME TABLE t1 TO c,v2 TO t", packet_length=28, blocking=true)at /test/preview-12.0-preview_dbg/sql/sql_parse.cc:1875
      #16 0x0000580224a62703 in do_command (thd=0x7ca234000d58, blocking=true)at /test/preview-12.0-preview_dbg/sql/sql_parse.cc:1416
      #17 0x0000580224c4f7e9 in do_handle_one_connection (connect=0x580228d115c8, put_in_cache=true)at /test/preview-12.0-preview_dbg/sql/sql_connect.cc:1415
      #18 0x0000580224c4f58e in handle_one_connection (arg=0x580228dc5a48)at /test/preview-12.0-preview_dbg/sql/sql_connect.cc:1327
      #19 0x00007cc123e9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #20 0x00007cc123f29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      The testcase is MTR and CLI compatible.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Dmitry Shulga made transition -
            Open Closed
            7d 21m 1
            Roel Van de Paar made transition -
            Closed Stalled
            20h 23m 1
            Roel Van de Paar made transition -
            Stalled Open
            4s 1
            Roel Van de Paar made transition -
            Open Confirmed
            2s 1
            Roel Van de Paar made transition -
            Confirmed Open
            6s 1
            Oleg Smirnov made transition -
            Open In Progress
            4d 2h 6m 1
            Oleg Smirnov made transition -
            In Progress Stalled
            2d 4h 7m 1
            Oleg Smirnov made transition -
            Stalled In Progress
            2d 23h 48m 1
            Oleg Smirnov made transition -
            In Progress In Review
            2d 1h 7m 1

            People

              monty Michael Widenius
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              5 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.