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

Assertion `inited==INDEX' failed in handler::ha_index_end upon concurrent SELECT and table re-creation

    XMLWordPrintable

Details

    Description

      Note: It is a concurrent test case, run with --repeat=N. Currently it always fails for me within 3 attempts, but it can vary on different machines and builds.

      --source include/have_innodb.inc
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      CREATE TABLE t2 (b INT) ENGINE=InnoDB;
      START TRANSACTION;
      SELECT * FROM t2;
      --connect (con1,localhost,root,,test)
      --send
      CREATE OR REPLACE TABLE t1 (a INT, KEY(a)) ENGINE=InnoDB;
      --connection default
      --error 0,ER_TABLE_DEF_CHANGED
      SELECT MAX(a) FROM t1;
       
      # Cleanup
      COMMIT;
      --connection con1
      --reap
      --disconnect con1
      --connection default
      DROP TABLE t1, t2;
      

      10.1 de0f93fb

      mysqld: /data/src/10.1/sql/handler.h:2786: int handler::ha_index_end(): Assertion `inited==INDEX' failed.
      190831 12:48:47 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f450dd01f12 in __GI___assert_fail (assertion=0x555914f29d04 "inited==INDEX", file=0x555914f29cbf "/data/src/10.1/sql/handler.h", line=2786, function=0x555914f2cfd0 <handler::ha_index_end()::__PRETTY_FUNCTION__> "int handler::ha_index_end()") at assert.c:101
      #8  0x0000555914528a06 in handler::ha_index_end (this=0x7f44f7caf888) at /data/src/10.1/sql/handler.h:2786
      #9  0x000055591491ede5 in opt_sum_query (thd=0x7f4504761070, tables=..., all_fields=..., conds=0x0) at /data/src/10.1/sql/opt_sum.cc:412
      #10 0x00005559145d7405 in JOIN::optimize_inner (this=0x7f44f7c45ad0) at /data/src/10.1/sql/sql_select.cc:1321
      #11 0x00005559145d6556 in JOIN::optimize (this=0x7f44f7c45ad0) at /data/src/10.1/sql/sql_select.cc:1059
      #12 0x00005559145deebb in mysql_select (thd=0x7f4504761070, rref_pointer_array=0x7f4504765570, tables=0x7f44f7c453d8, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2148797184, result=0x7f44f7c45ab0, unit=0x7f4504764bc0, select_lex=0x7f45047652c8) at /data/src/10.1/sql/sql_select.cc:3487
      #13 0x00005559145d4622 in handle_select (thd=0x7f4504761070, lex=0x7f4504764af8, result=0x7f44f7c45ab0, setup_tables_done_option=0) at /data/src/10.1/sql/sql_select.cc:377
      #14 0x00005559145a3827 in execute_sqlcom_select (thd=0x7f4504761070, all_tables=0x7f44f7c453d8) at /data/src/10.1/sql/sql_parse.cc:5691
      #15 0x000055591459a63f in mysql_execute_command (thd=0x7f4504761070) at /data/src/10.1/sql/sql_parse.cc:3038
      #16 0x00005559145a749f in mysql_parse (thd=0x7f4504761070, rawbuf=0x7f44f7c45088 "SELECT MAX(a) FROM t1", length=21, parser_state=0x7f450f71a1e0) at /data/src/10.1/sql/sql_parse.cc:7209
      #17 0x0000555914596651 in dispatch_command (command=COM_QUERY, thd=0x7f4504761070, packet=0x7f450469b071 "SELECT MAX(a) FROM t1", packet_length=21) at /data/src/10.1/sql/sql_parse.cc:1499
      #18 0x000055591459540f in do_command (thd=0x7f4504761070) at /data/src/10.1/sql/sql_parse.cc:1131
      #19 0x00005559146d2591 in do_handle_one_connection (thd_arg=0x7f4504761070) at /data/src/10.1/sql/sql_connect.cc:1331
      #20 0x00005559146d22c2 in handle_one_connection (arg=0x7f4504761070) at /data/src/10.1/sql/sql_connect.cc:1242
      #21 0x0000555914b07290 in pfs_spawn_thread (arg=0x7f4508bb03f0) at /data/src/10.1/storage/perfschema/pfs.cc:1861
      #22 0x00007f450f3a84a4 in start_thread (arg=0x7f450f71b700) at pthread_create.c:456
      #23 0x00007f450ddbed0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Non-debug build produces

      mysqltest: At line 12: query 'SELECT MAX(a) FROM t1' failed: 1412: Table definition has changed, please retry transaction
      

      which might be expected (it is masked in the test case above, so to see it, you need to remove the --error line.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.