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

Global temporary table can be created with system versioning using CREATE LIKE

    XMLWordPrintable

Details

    • Not for Release Notes
    • Q4/2025 Server Maintenance

    Description

      CREATE TABLE t0 (x INT UNSIGNED,y INT UNSIGNED) WITH SYSTEM VERSIONING;
      CREATE GLOBAL TEMPORARY TABLE t LIKE t0;
      INSERT INTO t VALUES (0),(0),(0);
      

      Leads to:

      MDEV-35915-5 CS 12.2.0 5a344faeb0bab8520ad5c92be6fc1fc0a9c56d52 (Debug, Clang 21.1.0-20250811) Build 16/09/2025

      mariadbd: /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc:6269: my_bool open_global_temporary_table(THD *, TABLE_SHARE *, TABLE_LIST *, MDL_ticket *): Assertion `!global_table.versioned()' failed.
      

      MDEV-35915-5 CS 12.2.0 5a344faeb0bab8520ad5c92be6fc1fc0a9c56d52 (Debug, Clang 21.1.0-20250811) Build 16/09/2025

      Core was generated by `/test/MDEV-35915_5_MD160925-mariadb-12.2.0-linux-x86_64-dbg/bin/mariadbd --no-d'.
      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 1372555)]
      (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  0x0000717412a4526e in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000717412a288ff in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000717412a2881b in __assert_fail_base (fmt=0x717412bd01e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5f2f321fe067 "!global_table.versioned()", file=file@entry=0x5f2f3208ec7a "/test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc", line=line@entry=6269, function=function@entry=0x5f2f3211d472 "my_bool open_global_temporary_table(THD *, TABLE_SHARE *, TABLE_LIST *, MDL_ticket *)") at ./assert/assert.c:94
      #6  0x0000717412a3b507 in __assert_fail (assertion=0x5f2f321fe067 "!global_table.versioned()", file=0x5f2f3208ec7a "/test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc", line=6269, function=0x5f2f3211d472 "my_bool open_global_temporary_table(THD *, TABLE_SHARE *, TABLE_LIST *, MDL_ticket *)") at ./assert/assert.c:103
      #7  0x00005f2f32e7b83b in open_global_temporary_table (thd=0x7172e0000d58, source=0x7172e0035640, out_table=0x7172e0019f70, mdl_ticket=0x5f2f36ac24d0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_table.cc:6269
      #8  0x00005f2f32bf6cb9 in open_table (thd=0x7172e0000d58, table_list=0x7172e0019f70, ot_ctx=0x71740812f9a8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:2351
      #9  0x00005f2f32bfbd21 in open_and_process_table (thd=0x7172e0000d58, tables=0x7172e0019f70, counter=0x71740812fa5c, flags=0, prelocking_strategy=0x71740812fac0, has_prelocking_list=false, ot_ctx=0x71740812f9a8)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:4308
      #10 0x00005f2f32bfab6b in open_tables (thd=0x7172e0000d58, options=@0x7172e0006734: {m_options = DDL_options_st::OPT_NONE}, start=0x71740812fa70, counter=0x71740812fa5c, flags=0, prelocking_strategy=0x71740812fac0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:4791
      #11 0x00005f2f32bfd91a in open_and_lock_tables (thd=0x7172e0000d58, options=@0x7172e0006734: {m_options = DDL_options_st::OPT_NONE}, tables=0x7172e0019f70, derived=true, flags=0, prelocking_strategy=0x71740812fac0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.cc:5779
      #12 0x00005f2f32a7ff8e in open_and_lock_tables (thd=0x7172e0000d58, tables=0x7172e0019f70, derived=true, flags=0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_base.h:544
      #13 0x00005f2f32cf368a in mysql_insert (thd=0x7172e0000d58, table_list=0x7172e0019f70, fields=@0x7172e00060e0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5f2f33dcafc0 <end_of_list>, last = 0x7172e00060e0, elements = 0}, <No data fields>}, values_list=@0x7172e0006128: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x7172e001ac38, last = 0x7172e001adc8, elements = 3}, <No data fields>}, update_fields=@0x7172e0006110: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5f2f33dcafc0 <end_of_list>, last = 0x7172e0006110, elements = 0}, <No data fields>}, update_values=@0x7172e00060f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5f2f33dcafc0 <end_of_list>, last = 0x7172e00060f8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_insert.cc:789
      #14 0x00005f2f32d58f03 in mysql_execute_command (thd=0x7172e0000d58, is_called_from_prepared_stmt=false)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:4459
      #15 0x00005f2f32d4fea8 in mysql_parse (thd=0x7172e0000d58, rawbuf=0x7172e0019e80 "INSERT INTO t VALUES (0),(0),(0)", length=32, parser_state=0x717408131a10)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:7894
      #16 0x00005f2f32d4d689 in dispatch_command (command=COM_QUERY, thd=0x7172e0000d58, packet=0x7172e000b1f9 "INSERT INTO t VALUES (0),(0),(0)", packet_length=32, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1882
      #17 0x00005f2f32d5092a in do_command (thd=0x7172e0000d58, blocking=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_parse.cc:1421
      #18 0x00005f2f32f431ce in do_handle_one_connection (connect=0x5f2f36ac24e8, put_in_cache=true)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1414
      #19 0x00005f2f32f42fb1 in handle_one_connection (arg=0x5f2f36ad3588)at /test/bb-12.2-nikita-global-tmp_dbg/sql/sql_connect.cc:1326
      #20 0x0000717412a9ca94 in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:447
      #21 0x0000717412b29c3c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      InnoDB and MyISAM both affected. Testcase is CLI and MTR compatible.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.