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

Assertion failure in Table_specification_st::finalize_locked_tables upon attempt to create an already existing table under lock

Details

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

    Description

      CREATE TABLE t (a INT);
      LOCK TABLE t WRITE;
      CREATE TABLE IF NOT EXISTS t (a INT);
       
      UNLOCK TABLES;
      DROP TABLE t;
      

      bb-main-monty efaa497684bcaf6d389447ce64f0c3cf1979b788

      mariadbd: /data/bld/preview-12.0-bb-main-monty/sql/sql_table.cc:4832: bool Table_specification_st::finalize_locked_tables(THD*, bool): Assertion `operation_failed || !pos_in_locked_tables->table' failed.
      250329 20:07:14 [ERROR] /share8t/bld/preview-12.0-bb-main-monty-debug/sql/mariadbd got signal 6 ;
       
      #9  0x00007fbc87453eb2 in __GI___assert_fail (assertion=0x56317fe6ea90 "operation_failed || !pos_in_locked_tables->table", file=0x56317fe6d360 "/data/bld/preview-12.0-bb-main-monty/sql/sql_table.cc", line=4832, function=0x56317fe6ea38 "bool Table_specification_st::finalize_locked_tables(THD*, bool)") at ./assert/assert.c:101
      #10 0x000056317eff6313 in Table_specification_st::finalize_locked_tables (this=0x7fbc7c681610, thd=0x7fbc60000dc8, operation_failed=false) at /data/bld/preview-12.0-bb-main-monty/sql/sql_table.cc:4832
      #11 0x000056317eff89a2 in mysql_create_table (thd=0x7fbc60000dc8, create_table=0x7fbc60018140, create_info=0x7fbc7c681610, alter_info=0x7fbc7c681490) at /data/bld/preview-12.0-bb-main-monty/sql/sql_table.cc:5649
      #12 0x000056317f012ed0 in Sql_cmd_create_table_like::execute (this=0x7fbc600180c8, thd=0x7fbc60000dc8) at /data/bld/preview-12.0-bb-main-monty/sql/sql_table.cc:13941
      #13 0x000056317eec5ed6 in mysql_execute_command (thd=0x7fbc60000dc8, is_called_from_prepared_stmt=false) at /data/bld/preview-12.0-bb-main-monty/sql/sql_parse.cc:5887
      #14 0x000056317eecc19d in mysql_parse (thd=0x7fbc60000dc8, rawbuf=0x7fbc60018020 "CREATE TABLE IF NOT EXISTS t (a INT)", length=36, parser_state=0x7fbc7c6822e0) at /data/bld/preview-12.0-bb-main-monty/sql/sql_parse.cc:7917
      #15 0x000056317eeb83ad in dispatch_command (command=COM_QUERY, thd=0x7fbc60000dc8, packet=0x7fbc6000bf79 "CREATE TABLE IF NOT EXISTS t (a INT)", packet_length=36, blocking=true) at /data/bld/preview-12.0-bb-main-monty/sql/sql_parse.cc:1903
      #16 0x000056317eeb6d06 in do_command (thd=0x7fbc60000dc8, blocking=true) at /data/bld/preview-12.0-bb-main-monty/sql/sql_parse.cc:1416
      #17 0x000056317f0c6d81 in do_handle_one_connection (connect=0x5631bb3ce618, put_in_cache=true) at /data/bld/preview-12.0-bb-main-monty/sql/sql_connect.cc:1415
      #18 0x000056317f0c6b02 in handle_one_connection (arg=0x5631bb46bf28) at /data/bld/preview-12.0-bb-main-monty/sql/sql_connect.cc:1327
      #19 0x000056317f64d13e in pfs_spawn_thread (arg=0x5631bb3ce188) at /data/bld/preview-12.0-bb-main-monty/storage/perfschema/pfs.cc:2198
      #20 0x00007fbc874a81c4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #21 0x00007fbc8752885c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      the code was added in the scope of MDEV-25292, so naturally there is no assertion failure on the baseline, the second CREATE there causes a warning (ER_TABLE_EXISTS_ERROR) as expected.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Aleksey Midenkov made transition -
            Open In Progress
            5d 15h 8m 1
            Aleksey Midenkov made transition -
            In Progress In Review
            1m 3s 1

            People

              monty Michael Widenius
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.