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

Assertion `!is_set() || (m_status == DA_EOF_BULK && is_bulk_op())' failed from sp_head::show_routine_code

    XMLWordPrintable

Details

    Description

      CREATE PROCEDURE test.p() SQL SECURITY INVOKER CALL test.p();
      SET max_session_mem_used=8192;
      SHOW PROCEDURE CODE p;
      

      Leads to:

      11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Debug)

      mariadbd: /test/11.5_dbg/sql/sql_error.cc:375: void Diagnostics_area::set_eof_status(THD*): Assertion `!is_set() || (m_status == DA_EOF_BULK && is_bulk_op())' failed.
      

      11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Debug)

      Core was generated by `/test/MD170524-mariadb-11.5.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=<optimized out>)at ./nptl/pthread_kill.c:44
      Download failed: Invalid argument.  Continuing without source file ./nptl/./nptl/pthread_kill.c.
      [Current thread is 1 (LWP 937084)]
      (gdb) bt
      #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=signo@entry=6)at ./nptl/pthread_kill.c:89
      #3  0x0000150deea42866 in __GI_raise (sig=sig@entry=6)at ../sysdeps/posix/raise.c:26
      #4  0x0000150deea268b7 in __GI_abort () at ./stdlib/abort.c:79
      #5  0x0000150deea267db in __assert_fail_base (fmt=0x150deebc5168 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x55c37209cd70 "!is_set() || (m_status == DA_EOF_BULK && is_bulk_op())", file=file@entry=0x55c37209cbd0 "/test/11.5_dbg/sql/sql_error.cc", line=line@entry=375, function=function@entry=0x55c37209cda8 "void Diagnostics_area::set_eof_status(THD*)") at ./assert/assert.c:92
      #6  0x0000150deea39186 in __assert_fail (assertion=0x55c37209cd70 "!is_set() || (m_status == DA_EOF_BULK && is_bulk_op())", file=0x55c37209cbd0 "/test/11.5_dbg/sql/sql_error.cc", line=375, function=0x55c37209cda8 "void Diagnostics_area::set_eof_status(THD*)")at ./assert/assert.c:101
      #7  0x000055c3713d1916 in Diagnostics_area::set_eof_status (this=0x150da8006e90, thd=thd@entry=0x150da8000d58)at /test/11.5_dbg/sql/sql_error.cc:375
      #8  0x000055c37135a564 in my_eof (thd=0x150da8000d58)at /test/11.5_dbg/sql/sql_class.h:4665
      #9  sp_head::show_routine_code (this=0x150da8020ef0, thd=thd@entry=0x150da8000d58) at /test/11.5_dbg/sql/sp_head.cc:3445
      #10 0x000055c3714235b9 in mysql_execute_command (thd=thd@entry=0x150da8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false)at /test/11.5_dbg/sql/sql_parse.cc:5579
      #11 0x000055c3714250a5 in mysql_parse (thd=thd@entry=0x150da8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x150dec118230)at /test/11.5_dbg/sql/sql_parse.cc:7815
      #12 0x000055c371427593 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x150da8000d58, packet=packet@entry=0x150da800b1e9 "", packet_length=packet_length@entry=21, blocking=blocking@entry=true)at /test/11.5_dbg/sql/sql_class.h:254
      #13 0x000055c371429861 in do_command (thd=0x150da8000d58, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_parse.cc:1405
      #14 0x000055c37159e1ce in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c375b60a38, put_in_cache=put_in_cache@entry=true)at /test/11.5_dbg/sql/sql_connect.cc:1445
      #15 0x000055c37159e4ce in handle_one_connection (arg=arg@entry=0x55c375b60a38)at /test/11.5_dbg/sql/sql_connect.cc:1347
      #16 0x000055c3719e2980 in pfs_spawn_thread (arg=0x55c375b167c8)at /test/11.5_dbg/storage/perfschema/pfs.cc:2201
      #17 0x0000150deea97ada in start_thread (arg=<optimized out>)at ./nptl/pthread_create.c:444
      #18 0x0000150deeb2847c in clone3 ()at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:78
      

      Interestingly, without the procedure definition, the sever knows not to execute:

      11.5.0 e4afa610539ae01164485554e2de839bea9de816 (Debug)

      11.5.0-dbg>SET max_session_mem_used=8192;
      Query OK, 0 rows affected (0.000 sec)
       
      11.5.0-dbg>SHOW PROCEDURE CODE p;
      ERROR 1290 (HY000): The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
      

      So potentially besides the bugfix, the order of checks may to be changed?

      Attachments

        Activity

          People

            shulga Dmitry Shulga
            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.