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

Assertion failure in Diagnostics_area::set_ok_status upon CREATE OR REPLACE causing ER_UPDATE_TABLE_USED

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a INT) ENGINE=MyISAM;
      CREATE TABLE tm (a INT) ENGINE=MERGE UNION(t);
      --error ER_UPDATE_TABLE_USED
      CREATE OR REPLACE TABLE t LIKE tm;
       
      # Cleanup
      DROP TABLE IF EXISTS tm, t;
      

      10.3 dd8833bf

      mysqld: /data/src/10.3/sql/sql_error.cc:335: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.
      221004 13:48:30 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f5d8889f662 in __GI___assert_fail (assertion=0x561e2135ab60 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=0x561e2135a7e0 "/data/src/10.3/sql/sql_error.cc", line=335, function=0x561e2135abc0 "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
      #8  0x0000561e1f688ea8 in Diagnostics_area::set_ok_status (this=0x62a0000657e8, affected_rows=0, last_insert_id=0, message=0x0) at /data/src/10.3/sql/sql_error.cc:335
      #9  0x0000561e1f5b7963 in my_ok (thd=0x62a000060208, affected_rows_arg=0, id=0, message=0x0) at /data/src/10.3/sql/sql_class.h:4955
      #10 0x0000561e1f9a48e7 in Sql_cmd_create_table_like::execute (this=0x62b000000330, thd=0x62a000060208) at /data/src/10.3/sql/sql_table.cc:11464
      #11 0x0000561e1f74f7d6 in mysql_execute_command (thd=0x62a000060208) at /data/src/10.3/sql/sql_parse.cc:6076
      #12 0x0000561e1f75b608 in mysql_parse (thd=0x62a000060208, rawbuf=0x62b000000228 "CREATE OR REPLACE TABLE t LIKE tm", length=33, parser_state=0x7f5d7df139d0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7855
      #13 0x0000561e1f732c56 in dispatch_command (command=COM_QUERY, thd=0x62a000060208, packet=0x6290000eb209 "CREATE OR REPLACE TABLE t LIKE tm", packet_length=33, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1852
      #14 0x0000561e1f72f80e in do_command (thd=0x62a000060208) at /data/src/10.3/sql/sql_parse.cc:1398
      #15 0x0000561e1faf2336 in do_handle_one_connection (connect=0x608000000ea8) at /data/src/10.3/sql/sql_connect.cc:1403
      #16 0x0000561e1faf1c32 in handle_one_connection (arg=0x608000000ea8) at /data/src/10.3/sql/sql_connect.cc:1308
      #17 0x0000561e2109d29f in pfs_spawn_thread (arg=0x615000004408) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #18 0x00007f5d88a4aea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x00007f5d8896aaef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.3-10.10.
      Non-debug build throws ER_UPDATE_TABLE_USED which is probably expected:

      CREATE OR REPLACE TABLE t LIKE tm;
      ERROR HY000: Table 'tm' is specified twice, both as a target for 'CREATE' and as a separate source for data
      

      In 10.11 MDEV-25292 introduced atomic create or replace, and it fails in a different way, see MDEV-29698.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.