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

Assertion failure in Diagnostics_area::disable_status / Query_cache::send_result_to_client upon 2nd execution of PS/SP

    XMLWordPrintable

Details

    Description

      Note: The failure is non-deterministic, run with big enough repeat=N. It usually fails on my machine within ~10 attempts, but sometimes it takes much longer, closer to 100.

      SET @cachetype= @@global.query_cache_type;
      SET GLOBAL query_cache_type= 1;
       
      --connect (con1,localhost,root,,)
      --let $conid= `select connection_id()`
      CREATE TABLE t (a INT);
      PREPARE stmt FROM "SELECT * FROM t";
      EXECUTE stmt;
      --send
      EXECUTE stmt;
       
      --connection default
      --eval KILL $conid
      DROP TABLE t;
      SET GLOBAL query_cache_type= @cachetype;
      

      10.4 7d89dcf1

      mysqld: /data/src/10.4/sql/sql_error.cc:484: void Diagnostics_area::disable_status(): Assertion `! is_set()' failed.
      231021 18:11:25 [ERROR] mysqld got signal 6 ;
       
      #9  0x00007fb94f653df2 in __GI___assert_fail (assertion=0x5589a6c80220 "! is_set()", file=0x5589a6c7fd60 "/data/src/10.4/sql/sql_error.cc", line=484, function=0x5589a6c805c0 "void Diagnostics_area::disable_status()") at ./assert/assert.c:101
      #10 0x00005589a4b17ce1 in Diagnostics_area::disable_status (this=0x62b000091c70) at /data/src/10.4/sql/sql_error.cc:484
      #11 0x00005589a4a97655 in Query_cache::send_result_to_client (this=0x5589a854ec60 <query_cache>, thd=0x62b00008c208, org_sql=0x62b0000932c0 "SELECT * FROM t", query_length=15) at /data/src/10.4/sql/sql_cache.cc:2203
      #12 0x00005589a4c54667 in Prepared_statement::execute (this=0x6190004a2488, expanded_query=0x7fb947690b30, open_cursor=false) at /data/src/10.4/sql/sql_prepare.cc:5056
      #13 0x00005589a4c4fd71 in Prepared_statement::execute_loop (this=0x6190004a2488, expanded_query=0x7fb947690b30, open_cursor=false, packet=0x0, packet_end=0x0) at /data/src/10.4/sql/sql_prepare.cc:4515
      #14 0x00005589a4c49be3 in mysql_sql_stmt_execute (thd=0x62b00008c208) at /data/src/10.4/sql/sql_prepare.cc:3587
      #15 0x00005589a4be48c7 in mysql_execute_command (thd=0x62b00008c208) at /data/src/10.4/sql/sql_parse.cc:3994
      #16 0x00005589a4c005bd in mysql_parse (thd=0x62b00008c208, rawbuf=0x62b000093228 "EXECUTE stmt", length=12, parser_state=0x7fb947692860, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8012
      #17 0x00005589a4bd684c in dispatch_command (command=COM_QUERY, thd=0x62b00008c208, packet=0x629001c39209 "EXECUTE stmt", packet_length=12, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
      #18 0x00005589a4bd33bb in do_command (thd=0x62b00008c208) at /data/src/10.4/sql/sql_parse.cc:1378
      #19 0x00005589a4fd2ee2 in do_handle_one_connection (connect=0x608000000aa8) at /data/src/10.4/sql/sql_connect.cc:1420
      #20 0x00005589a4fd27f9 in handle_one_connection (arg=0x608000000aa8) at /data/src/10.4/sql/sql_connect.cc:1324
      #21 0x00005589a5c4454a in pfs_spawn_thread (arg=0x615000003c88) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #22 0x00007fb94f6a7fd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #23 0x00007fb94f7285bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Query (0x62b0000932c0): SELECT * FROM t
       
      Connection ID (thread ID): 365
      Status: KILL_CONNECTION
      

      Also reproducible with a stored procedure instead of PS, and with a server shutdown instead of killing the connection.

      Since the connection is killed, there is no visible error from the query on a non-debug build (and nothing in the error log either).

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            elenst Elena Stepanova
            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.