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

Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt' with query cache, masking temporary table and view

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      SET @qcache= @@global.query_cache_type;
      SET GLOBAL query_cache_type= 1;
      SET query_cache_type= 1;
       
      CREATE TABLE t1 (a INT) ENGINE=InnoDB;
      CREATE VIEW v AS SELECT * FROM t1;
      CREATE TEMPORARY TABLE t1 (a INT) ENGINE=InnoDB;
       
      CREATE TABLE t2 (b INT) ENGINE=InnoDB;
       
      START TRANSACTION;
      SELECT * FROM t2 JOIN v;
      SELECT * FROM t2 JOIN v;
       
      # Cleanup
      COMMIT;
      DROP VIEW v;
      DROP TEMPORARY TABLE t1;
      DROP TABLE t2, t1;
      SET GLOBAL query_cache_type= @qcache;
      

      10.2 c711abd1

      mysqld: /data/src/10.2/sql/sql_parse.cc:3177: int mysql_execute_command(THD*): Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt' failed.
       
      #6  0x00007fb2321c840f in __assert_fail_base (fmt=0x7fb232331128 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x561f8b70cae8 "thd->transaction.stmt.is_empty() || thd->in_sub_stmt", file=0x561f8b70bfd0 "/data/src/10.2/sql/sql_parse.cc", line=3177, function=<optimized out>) at assert.c:92
      #7  0x00007fb2321d7662 in __GI___assert_fail (assertion=0x561f8b70cae8 "thd->transaction.stmt.is_empty() || thd->in_sub_stmt", file=0x561f8b70bfd0 "/data/src/10.2/sql/sql_parse.cc", line=3177, function=0x561f8b70cac8 "int mysql_execute_command(THD*)") at assert.c:101
      #8  0x0000561f8acbfdde in mysql_execute_command (thd=0x7fb1d4000d90) at /data/src/10.2/sql/sql_parse.cc:3177
      #9  0x0000561f8accddc0 in mysql_parse (thd=0x7fb1d4000d90, rawbuf=0x7fb1d4012708 "SELECT * FROM t2 JOIN v", length=23, parser_state=0x7fb22c63d5e0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7793
      #10 0x0000561f8acbc163 in dispatch_command (command=COM_QUERY, thd=0x7fb1d4000d90, packet=0x7fb1d4008b61 "SELECT * FROM t2 JOIN v", packet_length=23, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1827
      #11 0x0000561f8acbac7c in do_command (thd=0x7fb1d4000d90) at /data/src/10.2/sql/sql_parse.cc:1381
      #12 0x0000561f8ae12b26 in do_handle_one_connection (connect=0x561f8dcc6e10) at /data/src/10.2/sql/sql_connect.cc:1336
      #13 0x0000561f8ae1289a in handle_one_connection (arg=0x561f8dcc6e10) at /data/src/10.2/sql/sql_connect.cc:1241
      #14 0x0000561f8b61ad1f in pfs_spawn_thread (arg=0x561f8dcb1280) at /data/src/10.2/storage/perfschema/pfs.cc:1869
      #15 0x00007fb23269bea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #16 0x00007fb2322a0def in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

        Attachments

          Activity

            People

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