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

Assertion `! is_set() ' failed in Diagnostics_area::set_ok_status on killing CREATE OR REPLACE

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.12
    • Fix Version/s: 10.0.14
    • Component/s: None
    • Labels:
      None

      Description

      Note: it might be related to MDEV-6525

      10.0/sql/sql_error.cc:377: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `! is_set()' failed.
      140811 20:45:36 [ERROR] mysqld got signal 6 ;
      
      #6  0x00007f4aad4616f1 in *__GI___assert_fail (assertion=0xf282af "! is_set()", file=<optimized out>, line=377, function=0xf28ec0 "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:81
      #7  0x00000000006543ae in Diagnostics_area::set_ok_status (this=0x7f4aa1e180d8, affected_rows=0, last_insert_id=0, message=0x0) at 10.0/sql/sql_error.cc:377
      #8  0x0000000000611718 in my_ok (thd=0x7f4aa1e13070, affected_rows=0, id=0, message=0x0) at 10.0/sql/sql_class.h:3756
      #9  0x0000000000679ca4 in mysql_execute_command (thd=0x7f4aa1e13070) at 10.0/sql/sql_parse.cc:3031
      #10 0x0000000000682ec3 in mysql_parse (thd=0x7f4aa1e13070, rawbuf=0x7f4a9a362088 "CREATE OR REPLACE TABLE t1 LIKE tmp", length=35, parser_state=0x7f4aaf399610) at 10.0/sql/sql_parse.cc:6411
      #11 0x0000000000675d78 in dispatch_command (command=COM_QUERY, thd=0x7f4aa1e13070, packet=0x7f4aa7249071 "CREATE OR REPLACE TABLE t1 LIKE tmp", packet_length=35) at 10.0/sql/sql_parse.cc:1307
      #12 0x000000000067511d in do_command (thd=0x7f4aa1e13070) at 10.0/sql/sql_parse.cc:1004
      #13 0x00000000007913d2 in do_handle_one_connection (thd_arg=0x7f4aa1e13070) at 10.0/sql/sql_connect.cc:1379
      #14 0x0000000000791125 in handle_one_connection (arg=0x7f4aa1e13070) at 10.0/sql/sql_connect.cc:1293
      #15 0x0000000000cc3a52 in pfs_spawn_thread (arg=0x7f4aa72410f0) at 10.0/storage/perfschema/pfs.cc:1860
      #16 0x00007f4aaf01ab50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #17 0x00007f4aad51220d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
      

      Stack trace from:

      revision-id: bar@mariadb.org-20140811014545-jq6i8sft8g3lr37m
      revno: 4347
      branch-nick: 10.0
      

      Test case:

      # You might try to run it with --repeat if it does not fail at once
      
      --source include/have_innodb.inc
      
      CREATE TABLE t1 (col_int_nokey INT)  ENGINE=InnoDB;
      
      --let $con_id = `SELECT CONNECTION_ID()`
      CREATE OR REPLACE TEMPORARY TABLE tmp LIKE t1;
      LOCK TABLE t1 WRITE;
      
      --connect (con1,localhost,root,,test)
      
      --connection default
      --send
        CREATE OR REPLACE TABLE t1 LIKE tmp;
      
      --connection con1
      eval KILL QUERY $con_id;
      
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            monty Michael Widenius added a comment -

            Problem also existed for:
            CREATE OR REPLACE TABLE t1 (a int);

            The issue was that I didn't do proper error handling when reopening the table after it was created, which is required for a create or replace of a table that was locked.

            After my fix, the table will be created ok, but the relock will fail (as it's interrupted) and the table will not be locked anymore.

            Show
            monty Michael Widenius added a comment - Problem also existed for: CREATE OR REPLACE TABLE t1 (a int); The issue was that I didn't do proper error handling when reopening the table after it was created, which is required for a create or replace of a table that was locked. After my fix, the table will be created ok, but the relock will fail (as it's interrupted) and the table will not be locked anymore.
            Hide
            monty Michael Widenius added a comment -

            Fix pushed

            Show
            monty Michael Widenius added a comment - Fix pushed

              People

              • Assignee:
                monty Michael Widenius
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours
                  6h