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

Assertion `open_tables == 0 && temporary_tables == 0 && derived_tables == 0 && lock == 0 && locked_tables_mode == LTM_NONE && m_reprepare_observer == __null' failed in void THD::restore_backup_open_tables_state(Open_tables_backup *)

    XMLWordPrintable

Details

    • Not for Release Notes

    Description

      CREATE DATABASE fp; 
      USE fp;
      CREATE TABLE t1(a INT);
      CREATE TABLE t2(a INT);
      DELIMITER //
      CREATE FUNCTION f_ct2(s VARCHAR(64)) RETURNS INT
      BEGIN
        CREATE TEMPORARY TABLE IF NOT EXISTS fp.ttx(a INT);
        RETURN 1;
      END//
      DELIMITER ;
       
      SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='fp' AND f_ct2(TABLE_CATALOG)=1;
      

      Leads to

      MDEV-31342 CS 13.2.0 0019fbe2a5dcb37591608de2752adb3fd67b8117 (Debug, Clang 18.1.3-11) Build 18/09/2026

      mariadbd: /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_class.cc:5204: void THD::restore_backup_open_tables_state(Open_tables_backup *): Assertion `open_tables == 0 && temporary_tables == 0 && derived_tables == 0 && lock == 0 && locked_tables_mode == LTM_NONE && m_reprepare_observer == __null' failed.
      

      MDEV-31342 CS 13.2.0 0019fbe2a5dcb37591608de2752adb3fd67b8117 (Debug, Clang 18.1.3-11) Build 18/09/2026

      Core was generated by `/test/mtest/MDEV-31342/MD180926-mariadb-13.2.0-linux-x86_64-dbg/bin/mariadbd --'.
      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 1601654)]
      (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  0x000075768b04527e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x000075768b0288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000075768b02881b in __assert_fail_base (fmt=0x75768b1d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x6023c9766bc6 "open_tables == 0 && temporary_tables == 0 && derived_tables == 0 && lock == 0 && locked_tables_mode == LTM_NONE && m_reprepare_observer == __null", file=file@entry=0x6023c9765bce "/test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_class.cc", line=line@entry=5204, function=function@entry=0x6023c9766c58 "void THD::restore_backup_open_tables_state(Open_tables_backup *)") at ./assert/assert.c:96
      #6  0x000075768b03b517 in __assert_fail (assertion=0x6023c9766bc6 "open_tables == 0 && temporary_tables == 0 && derived_tables == 0 && lock == 0 && locked_tables_mode == LTM_NONE && m_reprepare_observer == __null", file=0x6023c9765bce "/test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_class.cc", line=5204, function=0x6023c9766c58 "void THD::restore_backup_open_tables_state(Open_tables_backup *)") at ./assert/assert.c:105
      #7  0x00006023c852579b in THD::restore_backup_open_tables_state (this=0x6d7554000d60, backup=0x7576649e6c28)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_class.cc:5199
      #8  0x00006023c86ba2e6 in get_all_tables (thd=0x6d7554000d60, tables=0x6d755401add0, cond=0x6d7554022090)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_show.cc:5928
      #9  0x00006023c86c799c in get_schema_tables_result (join=0x6d755401e690, executed_place=PROCESSED_BY_JOIN_EXEC)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_show.cc:10202
      #10 0x00006023c865c5a6 in JOIN::exec_inner (this=0x6d755401e690)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_select.cc:5103
      #11 0x00006023c865ba50 in JOIN::exec (this=0x6d755401e690)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_select.cc:4924
      #12 0x00006023c863601c in mysql_select (thd=0x6d7554000d60, tables=0x6d755401add0, fields=@0x6d755401a998: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x6d755401ad30, last = 0x6d755401ad30, elements = 1}, <No data fields>}, conds=0x6d755401ccb0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2701396736, result=0x6d755401e660, unit=0x6d75540052f0, select_lex=0x6d755401a6e0)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_select.cc:5350
      #13 0x00006023c8635af5 in handle_select (thd=0x6d7554000d60, lex=0x6d7554005210, result=0x6d755401e660, setup_tables_done_option=0)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_select.cc:638
      #14 0x00006023c85d1ba3 in execute_sqlcom_select (thd=0x6d7554000d60, all_tables=0x6d755401add0)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_parse.cc:6266
      #15 0x00006023c85c66c6 in mysql_execute_command (thd=0x6d7554000d60, is_called_from_prepared_stmt=false)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_parse.cc:4038
      #16 0x00006023c85be724 in mysql_parse (thd=0x6d7554000d60, rawbuf=0x6d755401a5b0 "SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES\n    WHERE TABLE_SCHEMA='fp' AND f_ct2(TABLE_CATALOG)=1", length=103, parser_state=0x7576649e9a80)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_parse.cc:8005
      #17 0x00006023c85bbaed in dispatch_command (command=COM_QUERY, thd=0x6d7554000d60, packet=0x6d755400b7e1 "", packet_length=103, blocking=true)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_parse.cc:1903
      #18 0x00006023c85bf2d3 in do_command (thd=0x6d7554000d60, blocking=true)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_parse.cc:1437
      #19 0x00006023c87cbaf9 in do_handle_one_connection (connect=0x6023f8be0310, put_in_cache=true)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_connect.cc:1514
      #20 0x00006023c87cb89e in handle_one_connection (arg=0x6023f8ccd410)at /test/mtest/MDEV-31342/preview-13.2-preview_dbg/sql/sql_connect.cc:1426
      #21 0x000075768b09cb84 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #22 0x000075768b129ecc in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              janlindstrom Jan Lindström
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 20m
                  20m

                  Git Integration

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