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

Assertion `thd->transaction->stmt.is_empty() || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed in bool open_normal_and_derived_tables(THD*, TABLE_LIST*, uint, uint)

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Development

    Description

      CREATE OR REPLACE TABLE t (a INT) ;
      CREATE OR REPLACE VIEW c (x) AS SELECT a FROM t;
      CREATE OR REPLACE GLOBAL TEMPORARY TABLE t (x INT KEY) ;
      GRANT SELECT (c) ON c to root@localhost;
      

      Leads to

      MDEV-35915 CS 12.2.0 c7ea08421d34fa7d45e27919a869ade968bd88c4 (Debug) Build 21/10/2025

      mariadbd: /test/mtest/MDEV-35915/12.2_dbg/sql/sql_base.cc:5856: bool open_normal_and_derived_tables(THD*, TABLE_LIST*, uint, uint): Assertion `thd->transaction->stmt.is_empty() || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed.
      

      MDEV-35915 CS 12.2.0 c7ea08421d34fa7d45e27919a869ade968bd88c4 (Debug) Build 21/10/2025

      Core was generated by `/test/mtest/MDEV-35915/GAL_MD211025-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadb'.
      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 557831)]
      (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=6)at ./nptl/pthread_kill.c:89
      #3  0x000063aa501eeb7e in my_write_core (sig=6)at /test/mtest/MDEV-35915/12.2_dbg/mysys/stacktrace.c:424
      #4  0x000063aa4f8aca95 in handle_fatal_signal (sig=6)at /test/mtest/MDEV-35915/12.2_dbg/sql/signal_handler.cc:298
      #5  <signal handler called>
      #6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      #7  __pthread_kill_internal (signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:78
      #8  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6)at ./nptl/pthread_kill.c:89
      #9  0x00007489d244527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #10 0x00007489d24288ff in __GI_abort () at ./stdlib/abort.c:79
      #11 0x00007489d242881b in __assert_fail_base (fmt=0x7489d25d01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x63aa50370ca0 "thd->transaction->stmt.is_empty() || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=file@entry=0x63aa5036f138 "/test/mtest/MDEV-35915/12.2_dbg/sql/sql_base.cc", line=line@entry=5856, function=function@entry=0x63aa50370d00 "bool open_normal_and_derived_tables(THD*, TABLE_LIST*, uint, uint)") at ./assert/assert.c:96
      #12 0x00007489d243b517 in __assert_fail (assertion=0x63aa50370ca0 "thd->transaction->stmt.is_empty() || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=0x63aa5036f138 "/test/mtest/MDEV-35915/12.2_dbg/sql/sql_base.cc", line=5856, function=0x63aa50370d00 "bool open_normal_and_derived_tables(THD*, TABLE_LIST*, uint, uint)") at ./assert/assert.c:105
      #13 0x000063aa4f3c53a0 in open_normal_and_derived_tables (thd=0x746700000d58, tables=0x746700038078, flags=0, dt_phases=2)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_base.cc:5856
      #14 0x000063aa4f392fc0 in mysql_table_grant (thd=0x746700000d58, table_list=0x746700038078, user_list=@0x7467000060c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x746700038058, last = 0x746700038058, elements = 1}, <No data fields>}, columns=@0x7467000387d0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x746700037fc0, last = 0x746700037fc0, elements = 1}, <No data fields>}, rights=NO_ACL, revoke_grant=false)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_acl.cc:7378
      #15 0x000063aa4f3a3cc5 in Sql_cmd_grant_table::execute_exact_table (this=0x7467000387b0, thd=0x746700000d58, table=0x746700038078)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_acl.cc:12657
      #16 0x000063aa4f3a4311 in Sql_cmd_grant_table::execute (this=0x7467000387b0, thd=0x746700000d58) at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_acl.cc:12739
      #17 0x000063aa4f484dfa in mysql_execute_command (thd=0x746700000d58, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_parse.cc:5862
      #18 0x000063aa4f48ac24 in mysql_parse (thd=0x746700000d58, rawbuf=0x746700037e60 "GRANT UPDATE (c) ON c to''", length=26, parser_state=0x7482214a22b0)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_parse.cc:7895
      #19 0x000063aa4f48a321 in wsrep_mysql_parse (thd=0x746700000d58, rawbuf=0x746700037e60 "GRANT UPDATE (c) ON c to''", length=26, parser_state=0x7482214a22b0)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_parse.cc:7705
      #20 0x000063aa4f47772d in dispatch_command (command=COM_QUERY, thd=0x746700000d58, packet=0x74670000b159 "GRANT UPDATE (c) ON c to''", packet_length=26, blocking=true)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_parse.cc:1869
      #21 0x000063aa4f4763f4 in do_command (thd=0x746700000d58, blocking=true)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_parse.cc:1421
      #22 0x000063aa4f669993 in do_handle_one_connection (connect=0x63aa82b0a3e8, put_in_cache=true)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_connect.cc:1414
      #23 0x000063aa4f669739 in handle_one_connection (arg=0x63aa82ac7ff8)at /test/mtest/MDEV-35915/12.2_dbg/sql/sql_connect.cc:1326
      #24 0x00007489d249caa4 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #25 0x00007489d2529c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: