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

Assertion `thd->lex->sql_command == SQLCOM_XA_COMMIT || (thd->lex->sql_command == SQLCOM_XA_ROLLBACK || (thd->lex->sql_command == SQLCOM_PRELOAD_KEYS && thd->get_stmt_da()->get_sql_errno() ))' failed in run_xa_complete_ordered

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • N/A
    • XA
    • None
    • Q2/2025 Development

    Description

      CLI:

      # mysqld options required for replay:  --log_bin=binlog --binlog_format=STATEMENT 
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      XA START 'a';
      CREATE TEMPORARY TABLE tt LIKE t;
      XA END 'a';
      SHUTDOWN;
      

      MTR:

      --source include/have_binlog_format_statement.inc
      --source include/have_innodb.inc
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      XA START 'a';
      CREATE TEMPORARY TABLE tt LIKE t;
      XA END 'a';
      SHUTDOWN;
      

      Leads to:

      bb-12.1-MDEV-32830_xa CS 12.0.1 dd6f8d29c276ec86b32a1833e9fd1f20751d16f8 (Debug) Build 12/05/2025

      mariadbd: /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:10311: void run_xa_complete_ordered(THD *): Assertion `thd->lex->sql_command == SQLCOM_XA_COMMIT || (thd->lex->sql_command == SQLCOM_XA_ROLLBACK || (thd->lex->sql_command == SQLCOM_PRELOAD_KEYS && thd->get_stmt_da()->get_sql_errno() ))' failed.
      

      bb-12.1-MDEV-32830_xa CS 12.0.1 dd6f8d29c276ec86b32a1833e9fd1f20751d16f8 (Debug) Build 12/05/2025

      Core was generated by `/test/MDEV-32830_MD120525-mariadb-12.0.1-linux-x86_64-dbg/bin/mariadbd --no-def'.
      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 464116)]
      (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  0x00007c59bc64526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x00007c59bc6288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x00007c59bc62881b in __assert_fail_base (fmt=0x7c59bc7d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5a4bd4ba7ef8 "thd->lex->sql_command == SQLCOM_XA_COMMIT || (thd->lex->sql_command == SQLCOM_XA_ROLLBACK || (thd->lex->sql_command == SQLCOM_PRELOAD_KEYS && thd->get_stmt_da()->get_sql_errno() ))", file=file@entry=0x5a4bd4bde90d "/test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc", line=line@entry=10311, function=function@entry=0x5a4bd4ac770b "void run_xa_complete_ordered(THD *)") at ./assert/assert.c:94
      #6  0x00007c59bc63b507 in __assert_fail (assertion=0x5a4bd4ba7ef8 "thd->lex->sql_command == SQLCOM_XA_COMMIT || (thd->lex->sql_command == SQLCOM_XA_ROLLBACK || (thd->lex->sql_command == SQLCOM_PRELOAD_KEYS && thd->get_stmt_da()->get_sql_errno() ))", file=0x5a4bd4bde90d "/test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc", line=10311, function=0x5a4bd4ac770b "void run_xa_complete_ordered(THD *)")at ./assert/assert.c:103
      #7  0x00005a4bd531f08c in run_xa_complete_ordered (thd=0x7c5864000d58)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:10308
      #8  0x00005a4bd530d1de in TC_LOG::run_commit_ordered (this=0x5a4bd69118b8 <mysql_bin_log>, thd=0x7c5864000d58, all=true)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:10345
      #9  0x00005a4bd530f039 in MYSQL_BIN_LOG::trx_group_commit_with_engines (this=0x5a4bd69118b8 <mysql_bin_log>, leader=0x7c59b4f1d628, tail=0x7c59b4f1d628, commit_by_rotate=false)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:9442
      #10 0x00005a4bd530d00b in MYSQL_BIN_LOG::trx_group_commit_leader (this=0x5a4bd69118b8 <mysql_bin_log>, leader=0x7c59b4f1d628)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:9151
      #11 0x00005a4bd530ca1b in MYSQL_BIN_LOG::write_transaction_with_group_commit (this=0x5a4bd69118b8 <mysql_bin_log>, entry=0x7c59b4f1d628)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:8985
      #12 0x00005a4bd531e88e in MYSQL_BIN_LOG::write_transaction_to_binlog_events (this=0x5a4bd69118b8 <mysql_bin_log>, entry=0x7c59b4f1d628)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:8936
      #13 0x00005a4bd530b6c2 in MYSQL_BIN_LOG::write_transaction_to_binlog (this=0x5a4bd69118b8 <mysql_bin_log>, thd=0x7c5864000d58, cache_mngr=0x7c5864025998, end_ev=0x7c59b4f1d780, all=true, using_stmt_cache=false, using_trx_cache=true, is_ro_1pc=false)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:8563
      #14 0x00005a4bd5318a50 in binlog_flush_cache (thd=0x7c5864000d58, cache_mngr=0x7c5864025998, end_ev=0x7c59b4f1d780, all=true, using_stmt=false, using_trx=true, is_ro_1pc=false)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:1933
      #15 0x00005a4bd53187f3 in binlog_rollback_flush_trx_cache (thd=0x7c5864000d58, all=true, cache_mngr=0x7c5864025998)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:2106
      #16 0x00005a4bd53181af in binlog_rollback (thd=0x7c5864000d58, all=true)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/log.cc:2521
      #17 0x00005a4bd532618d in ha_rollback_trans (thd=0x7c5864000d58, all=true)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/handler.cc:2373
      #18 0x00005a4bd5b4d08e in xa_trans_force_rollback (thd=0x7c5864000d58)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/xa.cc:477
      #19 0x00005a4bd5b4ee1a in trans_xa_detach (thd=0x7c5864000d58)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/xa.cc:960
      #20 0x00005a4bd5674cfa in THD::cleanup (this=0x7c5864000d58)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/sql_class.cc:1694
      #21 0x00005a4bd52cdfca in unlink_thd (thd=0x7c5864000d58)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/mysqld.cc:2867
      #22 0x00005a4bd59d8a55 in do_handle_one_connection (connect=0x5a4bd8a16ad8, put_in_cache=true)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/sql_connect.cc:1425
      #23 0x00005a4bd59d878e in handle_one_connection (arg=0x5a4bd89d4298)at /test/bb-12.1-MDEV-32830_xa_dbg/sql/sql_connect.cc:1326
      #24 0x00007c59bc69ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x00007c59bc729c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              Elkin Andrei Elkin
              Roel Roel Van de Paar
              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.