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

Assertion `thd->transaction->stmt.is_empty() || thd->in_sub_stmt' failed from execute_init_command on START SLAVE

    XMLWordPrintable

    Details

      Description

      Sporadic; repeat a few times if server does not immediately crash.

      CREATE OR REPLACE TABLE mysql.general_log (a INT);
      SET SESSION sql_log_off=1;
      SET GLOBAL init_slave='SELECT 3';
      SET GLOBAL log_output='TABLE';
      SET GLOBAL general_log=1;
      CHANGE MASTER TO master_host='127.0.0.1';
      START SLAVE sql_thread;
      

      Leads to:

      10.9.0 b5852ffbeebc3000982988383daeefb0549e058a (Debug)

      mysqld: /test/10.9_dbg/sql/sql_parse.cc:3477: int mysql_execute_command(THD*, bool): Assertion `thd->transaction->stmt.is_empty() || thd->in_sub_stmt' failed.
      

      10.9.0 b5852ffbeebc3000982988383daeefb0549e058a (Debug)

      Core was generated by `/test/MD140222-mariadb-10.9.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 0x14dd481fb700 (LWP 1601813))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014dd5f6e9859 in __GI_abort () at abort.c:79
      #2  0x000014dd5f6e9729 in __assert_fail_base (fmt=0x14dd5f87f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x557df50ebb88 "thd->transaction->stmt.is_empty() || thd->in_sub_stmt", file=0x557df50e7eb8 "/test/10.9_dbg/sql/sql_parse.cc", line=3477, function=<optimized out>) at assert.c:92
      #3  0x000014dd5f6faf36 in __GI___assert_fail (assertion=assertion@entry=0x557df50ebb88 "thd->transaction->stmt.is_empty() || thd->in_sub_stmt", file=file@entry=0x557df50e7eb8 "/test/10.9_dbg/sql/sql_parse.cc", line=line@entry=3477, function=function@entry=0x557df50ebb08 "int mysql_execute_command(THD*, bool)") at assert.c:101
      #4  0x0000557df4413fca in mysql_execute_command (thd=thd@entry=0x14dca8001c58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.9_dbg/sql/handler.h:1882
      #5  0x0000557df4401315 in mysql_parse (thd=thd@entry=0x14dca8001c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14dd481f9d90) at /test/10.9_dbg/sql/sql_parse.cc:8027
      #6  0x0000557df440ffb1 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14dca8001c58, packet=packet@entry=0x14dca8010590 "SELECT 3", packet_length=packet_length@entry=8, blocking=blocking@entry=true) at /test/10.9_dbg/sql/sql_class.h:1362
      #7  0x0000557df4412957 in execute_init_command (thd=0x14dca8001c58, init_command=<optimized out>, var_lock=<optimized out>) at /test/10.9_dbg/sql/sql_parse.cc:954
      #8  0x0000557df43227eb in handle_slave_sql (arg=arg@entry=0x557df7fedfe0) at /test/10.9_dbg/sql/slave.cc:5520
      #9  0x0000557df4a14d67 in pfs_spawn_thread (arg=0x557df7ecb9b8) at /test/10.9_dbg/storage/perfschema/pfs.cc:2201
      #10 0x000014dd5fbf8609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #11 0x000014dd5f7e6293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.2.42 (dbg), 10.3.33 (dbg), 10.4.23 (dbg), 10.5.14 (dbg), 10.6.6 (dbg), 10.7.2 (dbg), 10.8.1 (dbg), 10.9.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (opt), 10.3.33 (opt), 10.4.23 (opt), 10.5.14 (opt), 10.6.6 (opt), 10.7.2 (opt), 10.8.1 (opt), 10.9.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

          Issue Links

            Activity

              People

              Assignee:
              Elkin Andrei Elkin
              Reporter:
              Roel Roel Van de Paar
              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.