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

Assertion `! is_set() || m_can_overwrite_status ...' failed in Diagnostics_area::set_error_status when SET STATEMENT fails to restore

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 13.2
    • 11.4, 11.8, 12.3, 13.2
    • None
    • None

    Description

      Original 13.2 test case:

      let $D= `select @@datadir`;
      --mkdir $D/d-b
      set statement old_mode=MYSQL50_TABLE_NAMES for use `#mysql50#d-b`;
      select database(), @@old_mode;
      use test;
      set old_mode=MYSQL50_TABLE_NAMES;
      drop database `#mysql50#d-b`;
      

      but the bug is not 13.2 specific. SET STATEMENT works by 1) changing the value of a system variable; 2) executing the statement; 3) setting the value back. Certain sysvars have conditions when they can be changed. If the statement changes this condition in (2), the variable value cannot be set back, which triggers the assertion in DA as my_error() happens after the statement was completed successfully. Even we the assert is bypassed or solved somehow, it's not clear what to do in this case in general. Possible test cases:

      • variables that can be changed only outside of transaction:

        set statement binlog_direct_non_transactional_updates=0 for start transaction;
        

      • variables that require SUPER: SET STATEMENT ... REVOKE SUPER FROM current_user
      • variables that need no active replication: SET STATEMENT ... START SLAVE

      and so on. Many various cases. Can there be a generic solution for this at all?

      13.2.0-MariaDB-asan-debug-log source revision: dc266b6ff7610fbb10b00c86be47b9c7e86670e0
      mariadbd: /13.2/src/sql/sql_error.cc:478: void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*): Assertion `! is_set() || m_can_overwrite_status || ((m_status == DA_OK_BULK || m_status == DA_EOF_BULK) && is_bulk_op())' failed.
       
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=<optimized out>, signo=6) at ./nptl/pthread_kill.c:89
      #3  0x0000574f15e087a6 in my_write_core (sig=6) at /13.2/src/mysys/stacktrace.c:424
      #4  0x0000574f14103890 in handle_fatal_signal (sig=6) at /13.2/src/sql/signal_handler.cc:300
      #5  <signal handler called>
      #6  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:44
      #7  __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
      #8  __GI___pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #9  0x000074b6f1a4527e in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #10 0x000074b6f1a288ff in __GI_abort () at ./stdlib/abort.c:79
      #11 0x000074b6f1a2881b in __assert_fail_base (fmt=0x74b6f1bd1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x574f1353a6e0 "! is_set() || m_can_overwrite_status || ((m_status == DA_OK_BULK || m_status == DA_EOF_BULK) && is_bulk_op())", file=file@entry=0x574f13539ee0 "/13.2/src/sql/sql_error.cc", line=line@entry=478, function=function@entry=0x574f1353a780 "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at ./assert/assert.c:96
      #12 0x000074b6f1a3b517 in __assert_fail (assertion=0x574f1353a6e0 "! is_set() || m_can_overwrite_status || ((m_status == DA_OK_BULK || m_status == DA_EOF_BULK) && is_bulk_op())", file=0x574f13539ee0 "/13.2/src/sql/sql_error.cc", line=478, function=0x574f1353a780 "void Diagnostics_area::set_error_status(uint, const char*, const char*, const Sql_user_condition_identity&, const Sql_condition*)") at ./assert/assert.c:105
      #13 0x0000574f148a105a in Diagnostics_area::set_error_status (this=this@entry=0x52c000086670, sql_errno=sql_errno@entry=1231, message=message@entry=0x74b6e58c20a0 "Variable 'old_mode' can't be set to the value of ''", sqlstate=sqlstate@entry=0x574f135cf500 "42000", ucid=..., error_condition=<optimized out>) at /13.2/src/sql/sql_error.cc:478
      #14 0x0000574f148358fc in THD::raise_condition (this=this@entry=0x52c000080220, cond=cond@entry=0x74b6e58c2480) at /13.2/src/sql/sql_class.cc:1214
      #15 0x0000574f1459bf5b in THD::raise_condition (this=this@entry=0x52c000080220, sql_errno=sql_errno@entry=1231, sqlstate=sqlstate@entry=0x574f1348dcc0 "", level=<optimized out>, msg=msg@entry=0x74b6e58c20a0 "Variable 'old_mode' can't be set to the value of ''") at /13.2/src/sql/sql_class.h:5823
      #16 0x0000574f14584a4d in my_message_sql (error=<optimized out>, str=0x74b6e58c20a0 "Variable 'old_mode' can't be set to the value of ''", MyFlags=0) at /13.2/src/sql/mysqld.cc:3595
      #17 0x0000574f15deb305 in my_error (nr=1231, MyFlags=0) at /13.2/src/mysys/my_error.c:121
      #18 0x0000574f1468640a in sys_var::check (this=0x574f16a4bb40 <Sys_old_behavior>, thd=thd@entry=0x52c000080220, var=var@entry=0x519000061998) at /13.2/src/sql/set_var.cc:309
      #19 0x0000574f14688aeb in set_var::check (this=0x519000061998, thd=0x52c000080220) at /13.2/src/sql/set_var.cc:861
      #20 0x0000574f14689931 in sql_set_variables (thd=0x52c000080220, var_list=var_list@entry=(List<set_var_base> *) 0x52c000085a90 1 set_var_base's, free=free@entry=false) at /13.2/src/sql/set_var.cc:784
      #21 0x0000574f1490b2a0 in LEX::restore_set_statement_var (this=0x52c0000846d0) at /13.2/src/sql/sql_lex.cc:6389
      #22 0x0000574f149bfea9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x52c000080220, packet=<optimized out>, packet@entry=0x529000249221 "", packet_length=packet_length@entry=65, blocking=blocking@entry=true) at /13.2/src/sql/sql_parse.cc:2516
      #23 0x0000574f149c131e in do_command (thd=thd@entry=0x52c000080220, blocking=blocking@entry=true) at /13.2/src/sql/sql_parse.cc:1437
      #24 0x0000574f14e412d3 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x50b000004cb0, put_in_cache=put_in_cache@entry=true) at /13.2/src/sql/sql_connect.cc:1529
      #25 0x0000574f14e416d9 in handle_one_connection (arg=arg@entry=0x50b000004cb0) at /13.2/src/sql/sql_connect.cc:1441
      #26 0x000074b6f2a5ea42 in asan_thread_start (arg=0x74b6ef514000) at ../../../../src/libsanitizer/asan/asan_interceptors.cpp:234
      #27 0x000074b6f1a9cb84 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
      #28 0x000074b6f1b29ecc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              alice Alice Sherepa
              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.