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

Assertion `derived->table' failed in mysql_derived_merge_for_insert

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      CREATE TABLE t2 (b INT) ENGINE=InnoDB;
      CREATE VIEW v2 AS SELECT * FROM t2;
      --error ER_CANT_CREATE_TABLE
      CREATE OR REPLACE TABLE t2 (c INT) ENGINE=InnoDB ROW_FORMAT=PAGE;
      CREATE OR REPLACE VIEW t2 AS SELECT * FROM t1;
      --error ER_NON_UPDATABLE_TABLE
      LOAD DATA INFILE 'some_file' INTO TABLE v2;
       
      # Cleanup
      DROP VIEW IF EXISTS v2;
      DROP TABLE IF EXISTS t1, t2;
       
      SHOW TABLES;
      

      10.2 d18a66147cf

      mysqld: /data/src/10.2/sql/sql_derived.cc:549: bool mysql_derived_merge_for_insert(THD*, LEX*, TABLE_LIST*): Assertion `derived->table' failed.
      180331 19:19:18 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f7df1474ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x0000556f290caba2 in mysql_derived_merge_for_insert (thd=0x7f7da0000b00, lex=0x7f7da00045e0, derived=0x7f7da0012660) at /data/src/10.2/sql/sql_derived.cc:549
      #9  0x0000556f290ca147 in mysql_handle_single_derived (lex=0x7f7da00045e0, derived=0x7f7da0012660, phases=16) at /data/src/10.2/sql/sql_derived.cc:197
      #10 0x0000556f295118f6 in mysql_load (thd=0x7f7da0000b00, ex=0x7f7da00125d8, table_list=0x7f7da0012660, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_ERROR, ignore=false, read_file_from_client=false) at /data/src/10.2/sql/sql_load.cc:366
      #11 0x0000556f290feba6 in mysql_execute_command (thd=0x7f7da0000b00) at /data/src/10.2/sql/sql_parse.cc:4828
      #12 0x0000556f291083a8 in mysql_parse (thd=0x7f7da0000b00, rawbuf=0x7f7da00124f8 "LOAD DATA INFILE 'some_file' INTO TABLE v2", length=42, parser_state=0x7f7de40bf200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7914
      #13 0x0000556f290f6263 in dispatch_command (command=COM_QUERY, thd=0x7f7da0000b00, packet=0x7f7da0008951 "LOAD DATA INFILE 'some_file' INTO TABLE v2", packet_length=42, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1815
      #14 0x0000556f290f4bc6 in do_command (thd=0x7f7da0000b00) at /data/src/10.2/sql/sql_parse.cc:1369
      #15 0x0000556f29243480 in do_handle_one_connection (connect=0x556f2c888260) at /data/src/10.2/sql/sql_connect.cc:1335
      #16 0x0000556f2924320d in handle_one_connection (arg=0x556f2c888260) at /data/src/10.2/sql/sql_connect.cc:1241
      #17 0x0000556f296633de in pfs_spawn_thread (arg=0x556f2c8927d0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #18 0x00007f7df314b494 in start_thread (arg=0x7f7de40c0700) at pthread_create.c:333
      #19 0x00007f7df153193f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Release build doesn't crash, but SHOW TABLES at the end of test case still shows t2:

      SHOW TABLES;
      Tables_in_test
      t2
      

      Attachments

        Activity

          People

            varun Varun Gupta (Inactive)
            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.