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

Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed. in st_select_lex::fix_prepare_information

    XMLWordPrintable

Details

    Description

      CREATE VIEW v1 AS SELECT  6 ;
      CREATE PROCEDURE sp()  SELECT 1 FROM v1 ; 
      CREATE TEMPORARY TABLE v1 as SELECT  8 ;
      CALL sp() ;
      DROP TEMPORARY TABLE v1;
      CALL sp() ;
      

      mysqld: /home/alice/am/m4-10.4/src/sql/sql_lex.cc:4149: void st_select_lex::fix_prepare_information(THD*, Item**, Item**): Assertion `active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS' failed.
      240112 11:59:28 [ERROR] mysqld got signal 6 ;
       
       
      Server version: 10.4.33-MariaDB-debug-log source revision: 88c46aba753c0094ea16dc707bb76cc5254806c8
       
      /lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7f1d1e13afd6]
      sql/sql_lex.cc:4152(st_select_lex::fix_prepare_information(THD*, Item**, Item**))[0x5646c8b40a8f]
      sql/sql_select.cc:1458(JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x5646c8c6d812]
      sql/sql_union.cc:662(st_select_lex_unit::prepare_join(THD*, st_select_lex*, select_result*, unsigned long, bool))[0x5646c8e7dfbe]
      sql/sql_union.cc:1009(st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long))[0x5646c8e8175d]
      sql/sql_derived.cc:824(mysql_derived_prepare(THD*, LEX*, TABLE_LIST*))[0x5646c8adb097]
      sql/sql_derived.cc:200(mysql_handle_single_derived(LEX*, TABLE_LIST*, unsigned int))[0x5646c8ad7468]
      sql/table.cc:9090(TABLE_LIST::handle_derived(LEX*, unsigned int))[0x5646c8f0df5b]
      sql/sql_lex.h:4455(LEX::handle_list_of_derived(TABLE_LIST*, unsigned int))[0x5646c8b1faa4]
      sql/sql_lex.cc:4418(st_select_lex::handle_derived(LEX*, unsigned int))[0x5646c8b42017]
      sql/sql_select.cc:1243(JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x5646c8c6ab5e]
      sql/sql_select.cc:4809(mysql_select(THD*, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x5646c8c91c7b]
      sql/sql_select.cc:442(handle_select(THD*, LEX*, select_result*, unsigned long))[0x5646c8c62972]
      sql/sql_parse.cc:6523(execute_sqlcom_select(THD*, TABLE_LIST*))[0x5646c8bc9977]
      sql/sql_parse.cc:3980(mysql_execute_command(THD*))[0x5646c8bb6f97]
      sql/sp_head.cc:3761(sp_instr_stmt::exec_core(THD*, unsigned int*))[0x5646c8968d8a]
      sql/sp_head.cc:3491(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x5646c8967420]
      sql/sp_head.cc:3667(sp_instr_stmt::execute(THD*, unsigned int*))[0x5646c89684d8]
      sql/sp_head.cc:1372(sp_head::execute(THD*, bool))[0x5646c89597f7]
      sql/sp_head.cc:2407(sp_head::execute_procedure(THD*, List<Item>*))[0x5646c895fa36]
      sql/sql_parse.cc:3066(do_execute_sp(THD*, sp_head*))[0x5646c8bb0423]
      sql/sql_parse.cc:3308(Sql_cmd_call::execute(THD*))[0x5646c8bb201e]
      sql/sql_parse.cc:6266(mysql_execute_command(THD*))[0x5646c8bc72c5]
      sql/sql_parse.cc:8062(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x5646c8bd2ef3]
      sql/sql_parse.cc:1860(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x5646c8ba909f]
      sql/sql_parse.cc:1378(do_command(THD*))[0x5646c8ba5bca]
      sql/sql_connect.cc:1419(do_handle_one_connection(CONNECT*))[0x5646c8fbac46]
      sql/sql_connect.cc:1324(handle_one_connection)[0x5646c8fba4ea]
      perfschema/pfs.cc:1871(pfs_spawn_thread)[0x5646c9c59274]
      nptl/pthread_create.c:478(start_thread)[0x7f1d1e655609]
       
      Query (0x625000142990): SELECT 1 FROM v1
      

      The failure started happening after this commit in 10.4:

      commit 85f2e4f8e8c82978bd9cc0af9bfd2b549ea04d65
      Author: Dmitry Shulga <dmitry.shulga@mariadb.com>
      Date:   Fri Nov 24 16:28:31 2023 +0700
       
          MDEV-32466: Potential memory leak on executing of create view statement
      

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              alice Alice Sherepa
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.