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

Spider: Assertion `thd->transaction->stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed in close_thread_tables on INSERT DELAYED invoking a trigger

    XMLWordPrintable

    Details

      Description

      Possibly related to the other INSERT DELAYED bug(s) in Spider.

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t (c TEXT) ENGINE=SPIDER;
      CREATE TRIGGER tr BEFORE INSERT ON t FOR EACH ROW ROLLBACK TO SAVEPOINT x;
      INSERT DELAYED INTO t VALUES (1);
      

      Leads to:

      10.8.0 347f6d01e3b570dce49aa1ab42cb83021905a14d (Debug)

      mysqld: /test/10.8_dbg/sql/sql_base.cc:801: int close_thread_tables(THD*): Assertion `thd->transaction->stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed.
      

      10.8.0 347f6d01e3b570dce49aa1ab42cb83021905a14d (Debug)

      Core was generated by `/test/MD150122-mariadb-10.8.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x1497d0862700 (LWP 3289143))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001497dbb11859 in __GI_abort () at abort.c:79
      #2  0x00001497dbb11729 in __assert_fail_base (fmt=0x1497dbca7588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b03dc5d6e8 "thd->transaction->stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=0x55b03dc5cf98 "/test/10.8_dbg/sql/sql_base.cc", line=801, function=<optimized out>) at assert.c:92
      #3  0x00001497dbb22f36 in __GI___assert_fail (assertion=assertion@entry=0x55b03dc5d6e8 "thd->transaction->stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=file@entry=0x55b03dc5cf98 "/test/10.8_dbg/sql/sql_base.cc", line=line@entry=801, function=function@entry=0x55b03dc5f941 "int close_thread_tables(THD*)") at assert.c:101
      #4  0x000055b03cf090be in close_thread_tables (thd=0x14973c0cd7c8) at /test/10.8_dbg/sql/handler.h:1873
      #5  0x000055b03cf5badc in handle_delayed_insert (arg=arg@entry=0x14973c0cd7a8) at /test/10.8_dbg/sql/sql_insert.cc:3399
      #6  0x000055b03d5a19a2 in pfs_spawn_thread (arg=0x55b040c93778) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
      #7  0x00001497dc020609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #8  0x00001497dbc0e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Slightly different stack on 10.4 only, likely unrelated to this bug (i.e. pfs_spawn_thread):

      10.4.23 5e04c08d0af6b0da2e98d1327577264fbcbe4a06 (Debug)

      mysqld: /test/10.4_dbg/sql/sql_base.cc:897: void close_thread_tables(THD*): Assertion `thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)' failed.
      

      10.4.23 5e04c08d0af6b0da2e98d1327577264fbcbe4a06 (Debug)

      Core was generated by `/test/MD150122-mariadb-10.4.23-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      [Current thread is 1 (Thread 0x14e9040c3700 (LWP 3288901))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014e906c6f859 in __GI_abort () at abort.c:79
      #2  0x000014e906c6f729 in __assert_fail_base (fmt=0x14e906e05588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5628355843c0 "thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=0x562835583c70 "/test/10.4_dbg/sql/sql_base.cc", line=897, function=<optimized out>) at assert.c:92
      #3  0x000014e906c80f36 in __GI___assert_fail (assertion=assertion@entry=0x5628355843c0 "thd->transaction.stmt.is_empty() || thd->in_sub_stmt || (thd->state_flags & Open_tables_state::BACKUPS_AVAIL)", file=file@entry=0x562835583c70 "/test/10.4_dbg/sql/sql_base.cc", line=line@entry=897, function=function@entry=0x5628355843a0 "void close_thread_tables(THD*)") at assert.c:101
      #4  0x0000562834833c30 in close_thread_tables (thd=0x14e8a80d3920) at /test/10.4_dbg/sql/handler.h:1790
      #5  0x0000562834881eb1 in handle_delayed_insert (arg=0x14e8a80d3900) at /test/10.4_dbg/sql/sql_insert.cc:3276
      #6  0x000014e90717e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #7  0x000014e906d6c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.23 (dbg), 10.5.14 (dbg), 10.6.6 (dbg), 10.7.2 (dbg), 10.8.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (dbg), 10.2.42 (opt), 10.3.33 (dbg), 10.3.33 (opt), 10.4.23 (opt), 10.5.14 (opt), 10.6.6 (opt), 10.7.2 (opt), 10.8.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)

        Attachments

          Activity

            People

            Assignee:
            holyfoot Alexey Botchkov
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.