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

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

            alice Alice Sherepa created issue -
            alice Alice Sherepa made changes -
            Field Original Value New Value
            Affects Version/s 10.4 [ 22408 ]
            Affects Version/s 10.5 [ 23123 ]
            Affects Version/s 10.6 [ 24028 ]
            Affects Version/s 10.11 [ 27614 ]
            Affects Version/s 11.0 [ 28320 ]
            alice Alice Sherepa made changes -
            Description
            {noformat}
            /11.0/sql/sql_lex.cc:4792: 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.
            240110 16:31:17 [ERROR] mysqld got signal 6 ;

            Server version: 11.0.5-MariaDB-debug-log source revision: 5be8b13735cee9c224b2c1851d7a017f18c714cc

            linux/raise.c:51(__GI_raise)[0x7f1a860258eb]
            stdlib/abort.c:81(__GI_abort)[0x7f1a86010535]
            intl/loadmsgcat.c:1177(_nl_load_domain)[0x7f1a8601040f]
            /lib/x86_64-linux-gnu/libc.so.6(+0x301a2)[0x7f1a8601e1a2]
            sql/sql_lex.cc:4793(st_select_lex::fix_prepare_information(THD*, Item**, Item**))[0x55a8a4ad80ce]
            sql/sql_select.cc:1655(JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x55a8a4c4919e]
            sql/sql_union.cc:1100(st_select_lex_unit::prepare_join(THD*, st_select_lex*, select_result*, unsigned long long, bool))[0x55a8a4e9cd53]
            sql/sql_union.cc:1496(st_select_lex_unit::prepare(TABLE_LIST*, select_result*, unsigned long long))[0x55a8a4ea0818]
            sql/sql_derived.cc:840(mysql_derived_prepare(THD*, LEX*, TABLE_LIST*))[0x55a8a4a6d6c6]
            sql/sql_derived.cc:200(mysql_handle_single_derived(LEX*, TABLE_LIST*, unsigned int))[0x55a8a4a69a91]
            sql/table.cc:9762(TABLE_LIST::handle_derived(LEX*, unsigned int))[0x55a8a4f4bb25]
            sql/sql_lex.h:4567(LEX::handle_list_of_derived(TABLE_LIST*, unsigned int))[0x55a8a4a67ecc]
            sql/sql_lex.cc:5059(st_select_lex::handle_derived(LEX*, unsigned int))[0x55a8a4ad9613]
            sql/sql_select.cc:1431(JOIN::prepare(TABLE_LIST*, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x55a8a4c4631e]
            sql/sql_select.cc:5213(mysql_select(THD*, TABLE_LIST*, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x55a8a4c6e897]
            sql/sql_select.cc:628(handle_select(THD*, LEX*, select_result*, unsigned long long))[0x55a8a4c3e3fb]
            sql/sql_parse.cc:6338(execute_sqlcom_select(THD*, TABLE_LIST*))[0x55a8a4b64e70]
            sql/sql_parse.cc:3963(mysql_execute_command(THD*, bool))[0x55a8a4b533bc]
            sql/sp_head.cc:3921(sp_instr_stmt::exec_core(THD*, unsigned int*))[0x55a8a48ef085]
            sql/sp_head.cc:3646(sp_lex_keeper::reset_lex_and_exec_core(THD*, unsigned int*, bool, sp_instr*))[0x55a8a48ed674]
            sql/sp_head.cc:3827(sp_instr_stmt::execute(THD*, unsigned int*))[0x55a8a48ee80f]
            sql/sp_head.cc:1463(sp_head::execute(THD*, bool))[0x55a8a48df4b4]
            sql/sp_head.cc:2479(sp_head::execute_procedure(THD*, List<Item>*))[0x55a8a48e54d3]
            sql/sql_parse.cc:3040(do_execute_sp(THD*, sp_head*))[0x55a8a4b4c820]
            sql/sql_parse.cc:3285(Sql_cmd_call::execute(THD*))[0x55a8a4b4e331]
            sql/sql_parse.cc:6075(mysql_execute_command(THD*, bool))[0x55a8a4b62958]
            sql/sql_prepare.cc:5273(Prepared_statement::execute(String*, bool))[0x55a8a4c01f03]
            sql/sql_prepare.cc:4674(Prepared_statement::execute_loop(String*, bool, unsigned char*, unsigned char*))[0x55a8a4bfd1a7]
            sql/sql_prepare.cc:3588(mysql_stmt_execute_common(THD*, unsigned long, unsigned char*, unsigned char*, unsigned long, bool, bool))[0x55a8a4bf5f90]
            sql/sql_prepare.cc:3359(mysqld_stmt_execute(THD*, char*, unsigned int))[0x55a8a4bf5166]
            sql/sql_parse.cc:1821(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55a8a4b4539b]
            sql/sql_parse.cc:1407(do_command(THD*, bool))[0x55a8a4b427c0]
            sql/sql_connect.cc:1415(do_handle_one_connection(CONNECT*, bool))[0x55a8a5006139]
            sql/sql_connect.cc:1319(handle_one_connection)[0x55a8a5005a8f]
            perfschema/pfs.cc:2203(pfs_spawn_thread)[0x55a8a5c933b9]
            nptl/pthread_create.c:487(start_thread)[0x7f1a864ddfa3]
            x86_64/clone.S:97(clone)[0x7f1a860e706f]

            Query (0x62500041c9a8): SELECT test.func_1 ( 2 ) FROM view_2 WHERE test.func_3 ( `col_int_key` ) < `col_int_key`
            {noformat}
            {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            alice Alice Sherepa made changes -
            Description {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}
            alice Alice Sherepa made changes -
            Assignee Alice Sherepa [ alice ] Dmitry Shulga [ JIRAUSER47315 ]
            alice Alice Sherepa made changes -
            Summary [draft] 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 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
            alice Alice Sherepa made changes -
            Labels regression
            alice Alice Sherepa made changes -
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            alice Alice Sherepa made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            alice Alice Sherepa made changes -
            Priority Major [ 3 ] Blocker [ 1 ]
            alice Alice Sherepa made changes -
            Description {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}
            {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}

             maybe fixed MDEV-32965?? but it is in 11.4, not in 10.4-11.0 now
            alice Alice Sherepa made changes -
            alice Alice Sherepa made changes -
            Description {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}

             maybe fixed MDEV-32965?? but it is in 11.4, not in 10.4-11.0 now
            {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}

             maybe fixed by MDEV-32965?? but it is in 11.4, not in 10.4-11.0 now
            alice Alice Sherepa made changes -
            Description {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}

             maybe fixed by MDEV-32965?? but it is in 11.4, not in 10.4-11.0 now
            {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}
            alice Alice Sherepa made changes -
            Fix Version/s 11.1 [ 28549 ]
            alice Alice Sherepa made changes -
            Affects Version/s 11.1 [ 28549 ]
            alice Alice Sherepa made changes -
            Labels regression not-11.2+ regression
            shulga Dmitry Shulga made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Priority Blocker [ 1 ] Critical [ 2 ]

            after fix return assert in st_select_lex::fix_prepare_information

            sanja Oleksandr Byelkin added a comment - after fix return assert in st_select_lex::fix_prepare_information
            Roel Roel Van de Paar made changes -
            Description {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}
            {code:sql}
            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() ;
            {code}
            {noformat}
            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
            {noformat}
            The failure started happening after this commit in 10.4:
            {noformat}
            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
            {noformat}
            Roel Roel Van de Paar added a comment - - edited

            I ran into this one also, with a different testcase which also crashes 11.2+ (not-11.2+ tag removed):

            CREATE TABLE t AS SELECT 1 f;
            PREPARE t FROM 'SHOW CREATE TABLE t';
            DROP TABLE t;
            EXECUTE t;
            CREATE VIEW t AS SELECT 1;
            EXECUTE t;
            

            Leads to:

            11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug)

            mariadbd: /test/11.4_dbg/sql/sql_lex.cc:4803: 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.
            

            11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug)

            Core was generated by `/test/MD060224-mariadb-11.4.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=22732861322816)
                at ./nptl/pthread_kill.c:44
            [Current thread is 1 (LWP 2775461)]
            (gdb) bt
            #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22732861322816) at ./nptl/pthread_kill.c:44
            #1  __pthread_kill_internal (signo=6, threadid=22732861322816) at ./nptl/pthread_kill.c:78
            #2  __GI___pthread_kill (threadid=22732861322816, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
            #3  0x000014acff442476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
            #4  0x000014acff4287f3 in __GI_abort () at ./stdlib/abort.c:79
            #5  0x000014acff42871b in __assert_fail_base (fmt=0x14acff5dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562a3ca0c5b0 "active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS", file=0x562a3ca0a6eb "/test/11.4_dbg/sql/sql_lex.cc", line=4803, function=<optimized out>) at ./assert/assert.c:92
            #6  0x000014acff439e96 in __GI___assert_fail (assertion=0x562a3ca0c5b0 "active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS", file=0x562a3ca0a6eb "/test/11.4_dbg/sql/sql_lex.cc", line=4803, function=0x562a3ca0c628 "void st_select_lex::fix_prepare_information(THD*, Item**, Item**)") at ./assert/assert.c:101
            #7  0x0000562a3bdc879c in st_select_lex::fix_prepare_information (this=0x14acb802fe50, thd=0x14acb8000d58, conds=conds@entry=0x14acb80193e8, having_conds=having_conds@entry=0x14acb8019168) at /test/11.4_dbg/sql/sql_lex.cc:4803
            #8  0x0000562a3be74b90 in JOIN::prepare (this=this@entry=0x14acb8018f58, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=<optimized out>, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /test/11.4_dbg/sql/sql_select.cc:1655
            #9  0x0000562a3befaf82 in st_select_lex_unit::prepare_join (this=this@entry=0x14acb802e1e0, thd_arg=0x14acb8000d58, sl=sl@entry=0x14acb802fe50, tmp_result=tmp_result@entry=0x14acb8018e68, additional_options=additional_options@entry=0, is_union_select=is_union_select@entry=false) at /test/11.4_dbg/sql/sql_union.cc:1103
            #10 0x0000562a3befe4f0 in st_select_lex_unit::prepare (this=this@entry=0x14acb802e1e0, derived_arg=derived_arg@entry=0x14acb802d940, sel_result=0x14acb8018e68, additional_options=additional_options@entry=0) at /test/11.4_dbg/sql/sql_union.cc:1583
            #11 0x0000562a3bda9fe4 in mysql_derived_prepare (thd=0x14acb8000d58, lex=<optimized out>, derived=0x14acb802d940) at /test/11.4_dbg/sql/sql_derived.cc:840
            #12 0x0000562a3bda8313 in mysql_handle_derived (lex=lex@entry=0x14acb802bb28, phases=phases@entry=3) at /test/11.4_dbg/sql/sql_derived.cc:123
            #13 0x0000562a3bea5167 in mysqld_show_create_get_fields (thd=thd@entry=0x14acb8000d58, table_list=<optimized out>, table_list@entry=0x14acb802d940, field_list=field_list@entry=0x14ace81f8250, buffer=buffer@entry=0x14ace81f8270) at /test/11.4_dbg/sql/sql_show.cc:1234
            #14 0x0000562a3bea63e5 in mysqld_show_create (thd=thd@entry=0x14acb8000d58, table_list=table_list@entry=0x14acb802d940) at /test/11.4_dbg/sql/sql_show.cc:1339
            #15 0x0000562a3bdf8966 in mysql_execute_command (thd=0x14acb8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:4351
            #16 0x0000562a3be25915 in Prepared_statement::execute (this=this@entry=0x14acb802a108, expanded_query=expanded_query@entry=0x14ace81f9a90, open_cursor=open_cursor@entry=false) at /test/11.4_dbg/sql/sql_prepare.cc:5077
            #17 0x0000562a3be25cbe in Prepared_statement::execute_loop (this=this@entry=0x14acb802a108, expanded_query=expanded_query@entry=0x14ace81f9a90, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/11.4_dbg/sql/sql_prepare.cc:4461
            #18 0x0000562a3be26151 in mysql_sql_stmt_execute (thd=thd@entry=0x14acb8000d58) at /test/11.4_dbg/sql/sql_prepare.cc:3480
            #19 0x0000562a3bdf78c6 in mysql_execute_command (thd=thd@entry=0x14acb8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.4_dbg/sql/sql_parse.cc:3942
            #20 0x0000562a3bdfde39 in mysql_parse (thd=thd@entry=0x14acb8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ace81fa1e0) at /test/11.4_dbg/sql/sql_parse.cc:7798
            #21 0x0000562a3be001fc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14acb8000d58, packet=packet@entry=0x14acb800b1c9 "EXECUTE t", packet_length=packet_length@entry=9, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_class.h:254
            #22 0x0000562a3be02333 in do_command (thd=0x14acb8000d58, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:1406
            #23 0x0000562a3bf689fd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562a3f578bc8, put_in_cache=put_in_cache@entry=true) at /test/11.4_dbg/sql/sql_connect.cc:1417
            #24 0x0000562a3bf68cf2 in handle_one_connection (arg=arg@entry=0x562a3f578bc8) at /test/11.4_dbg/sql/sql_connect.cc:1319
            #25 0x0000562a3c3b5e9a in pfs_spawn_thread (arg=0x562a3f4e10d8) at /test/11.4_dbg/storage/perfschema/pfs.cc:2201
            #26 0x000014acff494ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
            #27 0x000014acff526850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
            

            Bug confirmed present in:
            MariaDB: 10.4.33 (dbg), 10.5.24 (dbg), 10.6.17 (dbg), 10.11.7 (dbg), 11.0.5 (dbg), 11.1.4 (dbg), 11.2.3 (dbg), 11.3.2 (dbg), 11.4.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.4.33 (opt), 10.5.24 (opt), 10.6.17 (opt), 10.11.7 (opt), 11.0.5 (opt), 11.1.4 (opt), 11.2.3 (opt), 11.3.2 (opt), 11.4.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.44 (dbg), 5.7.44 (opt), 8.0.36 (dbg), 8.0.36 (opt)

            Roel Roel Van de Paar added a comment - - edited I ran into this one also, with a different testcase which also crashes 11.2+ ( not-11.2+ tag removed): CREATE TABLE t AS SELECT 1 f; PREPARE t FROM 'SHOW CREATE TABLE t' ; DROP TABLE t; EXECUTE t; CREATE VIEW t AS SELECT 1; EXECUTE t; Leads to: 11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug) mariadbd: /test/11.4_dbg/sql/sql_lex.cc:4803: 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. 11.4.0 9b1ea6904965dd345478dedd80e181ad54c767da (Debug) Core was generated by `/test/MD060224-mariadb-11.4.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=22732861322816) at ./nptl/pthread_kill.c:44 [Current thread is 1 (LWP 2775461)] (gdb) bt #0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22732861322816) at ./nptl/pthread_kill.c:44 #1 __pthread_kill_internal (signo=6, threadid=22732861322816) at ./nptl/pthread_kill.c:78 #2 __GI___pthread_kill (threadid=22732861322816, signo=signo@entry=6) at ./nptl/pthread_kill.c:89 #3 0x000014acff442476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26 #4 0x000014acff4287f3 in __GI_abort () at ./stdlib/abort.c:79 #5 0x000014acff42871b in __assert_fail_base (fmt=0x14acff5dd130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562a3ca0c5b0 "active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS", file=0x562a3ca0a6eb "/test/11.4_dbg/sql/sql_lex.cc", line=4803, function=<optimized out>) at ./assert/assert.c:92 #6 0x000014acff439e96 in __GI___assert_fail (assertion=0x562a3ca0c5b0 "active_arena->is_stmt_prepare_or_first_stmt_execute() || active_arena->state == Query_arena::STMT_SP_QUERY_ARGUMENTS", file=0x562a3ca0a6eb "/test/11.4_dbg/sql/sql_lex.cc", line=4803, function=0x562a3ca0c628 "void st_select_lex::fix_prepare_information(THD*, Item**, Item**)") at ./assert/assert.c:101 #7 0x0000562a3bdc879c in st_select_lex::fix_prepare_information (this=0x14acb802fe50, thd=0x14acb8000d58, conds=conds@entry=0x14acb80193e8, having_conds=having_conds@entry=0x14acb8019168) at /test/11.4_dbg/sql/sql_lex.cc:4803 #8 0x0000562a3be74b90 in JOIN::prepare (this=this@entry=0x14acb8018f58, tables_init=<optimized out>, conds_init=<optimized out>, og_num=<optimized out>, order_init=<optimized out>, skip_order_by=<optimized out>, group_init=<optimized out>, having_init=<optimized out>, proc_param_init=<optimized out>, select_lex_arg=<optimized out>, unit_arg=<optimized out>) at /test/11.4_dbg/sql/sql_select.cc:1655 #9 0x0000562a3befaf82 in st_select_lex_unit::prepare_join (this=this@entry=0x14acb802e1e0, thd_arg=0x14acb8000d58, sl=sl@entry=0x14acb802fe50, tmp_result=tmp_result@entry=0x14acb8018e68, additional_options=additional_options@entry=0, is_union_select=is_union_select@entry=false) at /test/11.4_dbg/sql/sql_union.cc:1103 #10 0x0000562a3befe4f0 in st_select_lex_unit::prepare (this=this@entry=0x14acb802e1e0, derived_arg=derived_arg@entry=0x14acb802d940, sel_result=0x14acb8018e68, additional_options=additional_options@entry=0) at /test/11.4_dbg/sql/sql_union.cc:1583 #11 0x0000562a3bda9fe4 in mysql_derived_prepare (thd=0x14acb8000d58, lex=<optimized out>, derived=0x14acb802d940) at /test/11.4_dbg/sql/sql_derived.cc:840 #12 0x0000562a3bda8313 in mysql_handle_derived (lex=lex@entry=0x14acb802bb28, phases=phases@entry=3) at /test/11.4_dbg/sql/sql_derived.cc:123 #13 0x0000562a3bea5167 in mysqld_show_create_get_fields (thd=thd@entry=0x14acb8000d58, table_list=<optimized out>, table_list@entry=0x14acb802d940, field_list=field_list@entry=0x14ace81f8250, buffer=buffer@entry=0x14ace81f8270) at /test/11.4_dbg/sql/sql_show.cc:1234 #14 0x0000562a3bea63e5 in mysqld_show_create (thd=thd@entry=0x14acb8000d58, table_list=table_list@entry=0x14acb802d940) at /test/11.4_dbg/sql/sql_show.cc:1339 #15 0x0000562a3bdf8966 in mysql_execute_command (thd=0x14acb8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:4351 #16 0x0000562a3be25915 in Prepared_statement::execute (this=this@entry=0x14acb802a108, expanded_query=expanded_query@entry=0x14ace81f9a90, open_cursor=open_cursor@entry=false) at /test/11.4_dbg/sql/sql_prepare.cc:5077 #17 0x0000562a3be25cbe in Prepared_statement::execute_loop (this=this@entry=0x14acb802a108, expanded_query=expanded_query@entry=0x14ace81f9a90, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/11.4_dbg/sql/sql_prepare.cc:4461 #18 0x0000562a3be26151 in mysql_sql_stmt_execute (thd=thd@entry=0x14acb8000d58) at /test/11.4_dbg/sql/sql_prepare.cc:3480 #19 0x0000562a3bdf78c6 in mysql_execute_command (thd=thd@entry=0x14acb8000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.4_dbg/sql/sql_parse.cc:3942 #20 0x0000562a3bdfde39 in mysql_parse (thd=thd@entry=0x14acb8000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ace81fa1e0) at /test/11.4_dbg/sql/sql_parse.cc:7798 #21 0x0000562a3be001fc in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14acb8000d58, packet=packet@entry=0x14acb800b1c9 "EXECUTE t", packet_length=packet_length@entry=9, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_class.h:254 #22 0x0000562a3be02333 in do_command (thd=0x14acb8000d58, blocking=blocking@entry=true) at /test/11.4_dbg/sql/sql_parse.cc:1406 #23 0x0000562a3bf689fd in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562a3f578bc8, put_in_cache=put_in_cache@entry=true) at /test/11.4_dbg/sql/sql_connect.cc:1417 #24 0x0000562a3bf68cf2 in handle_one_connection (arg=arg@entry=0x562a3f578bc8) at /test/11.4_dbg/sql/sql_connect.cc:1319 #25 0x0000562a3c3b5e9a in pfs_spawn_thread (arg=0x562a3f4e10d8) at /test/11.4_dbg/storage/perfschema/pfs.cc:2201 #26 0x000014acff494ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442 #27 0x000014acff526850 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81 Bug confirmed present in: MariaDB: 10.4.33 (dbg), 10.5.24 (dbg), 10.6.17 (dbg), 10.11.7 (dbg), 11.0.5 (dbg), 11.1.4 (dbg), 11.2.3 (dbg), 11.3.2 (dbg), 11.4.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.4.33 (opt), 10.5.24 (opt), 10.6.17 (opt), 10.11.7 (opt), 11.0.5 (opt), 11.1.4 (opt), 11.2.3 (opt), 11.3.2 (opt), 11.4.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.44 (dbg), 5.7.44 (opt), 8.0.36 (dbg), 8.0.36 (opt)
            Roel Roel Van de Paar made changes -
            Affects Version/s 11.2 [ 28603 ]
            Affects Version/s 11.3 [ 28565 ]
            Affects Version/s 11.4 [ 29301 ]
            Roel Roel Van de Paar made changes -
            Fix Version/s 11.2 [ 28603 ]
            Fix Version/s 11.3 [ 28565 ]
            Roel Roel Van de Paar made changes -
            Labels not-11.2+ regression regression
            shulga Dmitry Shulga made changes -
            Assignee Dmitry Shulga [ JIRAUSER47315 ] Oleksandr Byelkin [ sanja ]
            Status In Progress [ 3 ] In Review [ 10002 ]

            first fix all failures on the buildbot (and BTW it is not task of reviewer to monitor the buildbot)

            sanja Oleksandr Byelkin added a comment - first fix all failures on the buildbot (and BTW it is not task of reviewer to monitor the buildbot)
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Dmitry Shulga [ JIRAUSER47315 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            shulga Dmitry Shulga added a comment -

            The task is ready for review. Discovered issued was fixed.

            shulga Dmitry Shulga added a comment - The task is ready for review. Discovered issued was fixed.
            shulga Dmitry Shulga made changes -
            Assignee Dmitry Shulga [ JIRAUSER47315 ] Oleksandr Byelkin [ sanja ]
            Status Stalled [ 10000 ] In Review [ 10002 ]

            OK to push

            sanja Oleksandr Byelkin added a comment - OK to push
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Dmitry Shulga [ JIRAUSER47315 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            shulga Dmitry Shulga made changes -
            Component/s Prepared Statements [ 10804 ]
            Component/s Stored routines [ 13905 ]
            Fix Version/s 10.4.34 [ 29625 ]
            Fix Version/s 10.5.25 [ 29626 ]
            Fix Version/s 10.6.18 [ 29627 ]
            Fix Version/s 10.11.8 [ 29630 ]
            Fix Version/s 11.0.6 [ 29628 ]
            Fix Version/s 11.1.5 [ 29629 ]
            Fix Version/s 11.2.4 [ 29631 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.0 [ 28320 ]
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.3 [ 28565 ]
            Fix Version/s 11.2 [ 28603 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            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.