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

Assertion failure upon 2nd execution of SP trying to set collation on non-existing database

Details

    Description

      CREATE PROCEDURE p() ALTER SCHEMA db DEFAULT COLLATE = utf8_bin;
      --error 1
      CALL p;
      --error 1
      CALL p;
       
      # Cleanup
      DROP PROCEDURE p;
      

      10.9 91a7e9eb

      mariadbd: /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_table.cc:12448: bool HA_CREATE_INFO::resolve_to_charset_collation_context(THD*, const Lex_table_charset_collation_attrs_st&, const Lex_table_charset_collation_attrs_st&, const Charset_collation_context&): Assertion `!default_table_charset || thd->stmt_arena->is_stmt_execute()' failed.
      221113  0:43:59 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ff04b8e1662 in __GI___assert_fail (assertion=0x55c36d3c8820 "!default_table_charset || thd->stmt_arena->is_stmt_execute()", file=0x55c36d3bf200 "/home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_table.cc", line=12448, function=0x55c36d3c8880 "bool HA_CREATE_INFO::resolve_to_charset_collation_context(THD*, const Lex_table_charset_collation_attrs_st&, const Lex_table_charset_collation_attrs_st&, const Charset_collation_context&)") at assert.c:101
      #8  0x000055c36b639db3 in HA_CREATE_INFO::resolve_to_charset_collation_context (this=0x62500017fcf8, thd=0x62b00007e218, default_cscl_arg=..., convert_cscl=..., ctx=...) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_table.cc:12448
      #9  0x000055c36b369c89 in Table_specification_st::resolve_to_charset_collation_context (this=0x62500017fcf8, thd=0x62b00007e218, ctx=...) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/handler.h:2377
      #10 0x000055c36b34705c in mysql_execute_command (thd=0x62b00007e218, is_called_from_prepared_stmt=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5228
      #11 0x000055c36b0e1ca3 in sp_instr_stmt::exec_core (this=0x62500017d108, thd=0x62b00007e218, nextp=0x7ff0422dcb20) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3857
      #12 0x000055c36b0e027b in sp_lex_keeper::reset_lex_and_exec_core (this=0x62500017d150, thd=0x62b00007e218, nextp=0x7ff0422dcb20, open_tables=false, instr=0x62500017d108) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3582
      #13 0x000055c36b0e1428 in sp_instr_stmt::execute (this=0x62500017d108, thd=0x62b00007e218, nextp=0x7ff0422dcb20) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:3763
      #14 0x000055c36b0d2085 in sp_head::execute (this=0x62500017c138, thd=0x62b00007e218, merge_da_on_success=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:1459
      #15 0x000055c36b0d8152 in sp_head::execute_procedure (this=0x62500017c138, thd=0x62b00007e218, args=0x62b000083538) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sp_head.cc:2446
      #16 0x000055c36b336e6c in do_execute_sp (thd=0x62b00007e218, sp=0x62500017c138) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3023
      #17 0x000055c36b3389ff in Sql_cmd_call::execute (this=0x6290000e6300, thd=0x62b00007e218) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:3269
      #18 0x000055c36b34ca50 in mysql_execute_command (thd=0x62b00007e218, is_called_from_prepared_stmt=false) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:5997
      #19 0x000055c36b359c79 in mysql_parse (thd=0x62b00007e218, rawbuf=0x6290000e6238 "CALL p", length=6, parser_state=0x7ff0422de990) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:8023
      #20 0x000055c36b33041a in dispatch_command (command=COM_QUERY, thd=0x62b00007e218, packet=0x62900025d219 "CALL p", packet_length=6, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1894
      #21 0x000055c36b32d1f9 in do_command (thd=0x62b00007e218, blocking=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_parse.cc:1407
      #22 0x000055c36b7cddb0 in do_handle_one_connection (connect=0x6080000026b8, put_in_cache=true) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1416
      #23 0x000055c36b7cd746 in handle_one_connection (arg=0x608000002638) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/sql/sql_connect.cc:1318
      #24 0x000055c36c3a4ed0 in pfs_spawn_thread (arg=0x617000004d98) at /home/jenkins/workspace/sandbox-elenst/Nightly-Build-CS/src/storage/perfschema/pfs.cc:2201
      #25 0x00007ff04bdbfea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x00007ff04b9acaef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      No obvious problem on a non-debug build, it returns the same error on both invocations.

      The failure started happening after this commit in 10.9.2:

      commit 208addf48444c0a36a2cc16cd2558ae694e905d5
      Author: Alexander Barkov
      Date:   Tue May 17 12:52:23 2022 +0400
       
          Main patch MDEV-27896 Wrong result upon `COLLATE latin1_bin CHARACTER SET latin1` on the table or the database level
      

      Attachments

        Issue Links

          Activity

            The server also crashes when calling SP sys.optimizer_switch_on which creates a temporary table using the SEQUENCE engine.

            SET SESSION enforce_storage_engine=SEQUENCE;
            CALL sys.optimizer_switch_on();
            CALL sys.optimizer_switch_on();
             
             
            11.0.1>SET SESSION enforce_storage_engine=SEQUENCE;
            Query OK, 0 rows affected (0.000 sec)
             
            11.0.1>CALL sys.optimizer_switch_on();
            ERROR 1005 (HY000): Can't create table `sys`.`tmp_opt_switch` (errno: 131 "Command not supported by the engine")
            11.0.1>CALL sys.optimizer_switch_on();
            ERROR 2013 (HY000): Lost connection to server during query
            11.0.1>
            

            Leads to

            11.0.1 f9b33ac570337be320f718d52fd88d301a2bc1e7

            mariadbd: /test/mtest/11.0/sql/sql_table.cc:12649: bool HA_CREATE_INFO::resolve_to_charset_collation_context(THD*, const Lex_table_charset_collation_attrs_st&, const Lex_table_charset_collation_attrs_st&, const Charset_collation_context&): Assertion `!default_table_charset || thd->stmt_arena->is_stmt_execute()' failed.
            

            11.0.1 f9b33ac570337be320f718d52fd88d301a2bc1e7

            Core was generated by `/test/mtest/mariadb-11.0.1-linux-x86_64-alter/bin/mariadbd --no-defaults --core'.
            Program terminated with signal SIGABRT, Aborted.
            #0  __pthread_kill (threadid=<optimized out>, signo=6)
                at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            [Current thread is 1 (Thread 0x152e80163700 (LWP 2541034))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000056246ef1e143 in my_write_core (sig=6) at /test/mtest/11.0/mysys/stacktrace.c:424
            #2  0x000056246e688e0c in handle_fatal_signal (sig=6) at /test/mtest/11.0/sql/signal_handler.cc:357
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x0000152e94ffc859 in __GI_abort () at abort.c:79
            #6  0x0000152e94ffc729 in __assert_fail_base (fmt=0x152e95192588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56246f096358 "!default_table_charset || thd->stmt_arena->is_stmt_execute()", file=0x56246f093040 "/test/mtest/11.0/sql/sql_table.cc", line=12649, function=<optimized out>) at assert.c:92
            #7  0x0000152e9500dfd6 in __GI___assert_fail (assertion=0x56246f096358 "!default_table_charset || thd->stmt_arena->is_stmt_execute()", file=0x56246f093040 "/test/mtest/11.0/sql/sql_table.cc", line=12649, function=0x56246f096398 "bool HA_CREATE_INFO::resolve_to_charset_collation_context(THD*, const Lex_table_charset_collation_attrs_st&, const Lex_table_charset_collation_attrs_st&, const Charset_collation_context&)") at assert.c:101
            #8  0x000056246e3e5a45 in HA_CREATE_INFO::resolve_to_charset_collation_context (this=0x152e3805aac0, thd=0x152e38000db8, default_cscl_arg=@0x152e3805ad08: {<Lex_opt_context_charset_st> = {m_had_charset_default = false}, <Lex_exact_charset_extended_collation_attrs_st> = {m_ci = 0x56246fbc1800 <my_charset_latin1>, m_type = Lex_exact_charset_extended_collation_attrs_st::TYPE_CHARACTER_SET}, m_charset_order = Lex_extended_charset_extended_collation_attrs_st::CHARSET_TYPE_EXACT}, convert_cscl=@0x152e3805ad20: {<Lex_opt_context_charset_st> = {m_had_charset_default = false}, <Lex_exact_charset_extended_collation_attrs_st> = {m_ci = 0x0, m_type = Lex_exact_charset_extended_collation_attrs_st::TYPE_EMPTY}, m_charset_order = Lex_extended_charset_extended_collation_attrs_st::CHARSET_TYPE_EMPTY}, ctx=@0x152e8015ef10: {m_charset_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>, m_with_collate = false}, m_collate_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>}}) at /test/mtest/11.0/sql/sql_table.cc:12649
            #9  0x000056246e2c2e21 in Table_specification_st::resolve_to_charset_collation_context (this=0x152e3805aac0, thd=0x152e38000db8, ctx=@0x152e8015ef10: {m_charset_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>, m_with_collate = false}, m_collate_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>}}) at /test/mtest/11.0/sql/handler.h:2395
            #10 0x000056246e3e4afa in Sql_cmd_create_table_like::execute (this=0x152e380484a0, thd=0x152e38000db8) at /test/mtest/11.0/sql/sql_table.cc:12321
            #11 0x000056246e2b6a7f in mysql_execute_command (thd=0x152e38000db8, is_called_from_prepared_stmt=false) at /test/mtest/11.0/sql/sql_parse.cc:6001
            #12 0x000056246e1a8f6b in sp_instr_stmt::exec_core (this=0x152e3804d048, thd=0x152e38000db8, nextp=0x152e8015f9fc) at /test/mtest/11.0/sql/sp_head.cc:3857
            #13 0x000056246e1a827c in sp_lex_keeper::reset_lex_and_exec_core (this=0x152e3804d090, thd=0x152e38000db8, nextp=0x152e8015f9fc, open_tables=false, instr=0x152e3804d048) at /test/mtest/11.0/sql/sp_head.cc:3582
            #14 0x000056246e1a8b0f in sp_instr_stmt::execute (this=0x152e3804d048, thd=0x152e38000db8, nextp=0x152e8015f9fc) at /test/mtest/11.0/sql/sp_head.cc:3763
            #15 0x000056246e1a1dc3 in sp_head::execute (this=0x152e380465f0, thd=0x152e38000db8, merge_da_on_success=true) at /test/mtest/11.0/sql/sp_head.cc:1459
            #16 0x000056246e1a4a80 in sp_head::execute_procedure (this=0x152e380465f0, thd=0x152e38000db8, args=0x152e3803d650) at /test/mtest/11.0/sql/sp_head.cc:2446
            #17 0x000056246e2ac16b in do_execute_sp (thd=0x152e38000db8, sp=0x152e380465f0) at /test/mtest/11.0/sql/sql_parse.cc:3026
            #18 0x000056246e2acdc5 in Sql_cmd_call::execute (this=0x152e3803a620, thd=0x152e38000db8) at /test/mtest/11.0/sql/sql_parse.cc:3271
            #19 0x000056246e2b6a7f in mysql_execute_command (thd=0x152e38000db8, is_called_from_prepared_stmt=false) at /test/mtest/11.0/sql/sql_parse.cc:6001
            #20 0x000056246e1a8f6b in sp_instr_stmt::exec_core (this=0x152e3803a8b0, thd=0x152e38000db8, nextp=0x152e80160efc) at /test/mtest/11.0/sql/sp_head.cc:3857
            #21 0x000056246e1a827c in sp_lex_keeper::reset_lex_and_exec_core (this=0x152e3803a8f8, thd=0x152e38000db8, nextp=0x152e80160efc, open_tables=false, instr=0x152e3803a8b0) at /test/mtest/11.0/sql/sp_head.cc:3582
            #22 0x000056246e1a8b0f in sp_instr_stmt::execute (this=0x152e3803a8b0, thd=0x152e38000db8, nextp=0x152e80160efc) at /test/mtest/11.0/sql/sp_head.cc:3763
            #23 0x000056246e1a1dc3 in sp_head::execute (this=0x152e380391a0, thd=0x152e38000db8, merge_da_on_success=true) at /test/mtest/11.0/sql/sp_head.cc:1459
            #24 0x000056246e1a4a80 in sp_head::execute_procedure (this=0x152e380391a0, thd=0x152e38000db8, args=0x152e38006138) at /test/mtest/11.0/sql/sp_head.cc:2446
            #25 0x000056246e2ac16b in do_execute_sp (thd=0x152e38000db8, sp=0x152e380391a0) at /test/mtest/11.0/sql/sql_parse.cc:3026
            #26 0x000056246e2acdc5 in Sql_cmd_call::execute (this=0x152e38013f78, thd=0x152e38000db8) at /test/mtest/11.0/sql/sql_parse.cc:3271
            #27 0x000056246e2b6a7f in mysql_execute_command (thd=0x152e38000db8, is_called_from_prepared_stmt=false) at /test/mtest/11.0/sql/sql_parse.cc:6001
            #28 0x000056246e2bcafc in mysql_parse (thd=0x152e38000db8, rawbuf=0x152e38013e90 "CALL sys.optimizer_switch_on()", length=30, parser_state=0x152e80162310) at /test/mtest/11.0/sql/sql_parse.cc:8000
            #29 0x000056246e2a8f7f in dispatch_command (command=COM_QUERY, thd=0x152e38000db8, packet=0x152e3800b939 "CALL sys.optimizer_switch_on()", packet_length=30, blocking=true) at /test/mtest/11.0/sql/sql_parse.cc:1894
            #30 0x000056246e2a793e in do_command (thd=0x152e38000db8, blocking=true) at /test/mtest/11.0/sql/sql_parse.cc:1407
            #31 0x000056246e490019 in do_handle_one_connection (connect=0x56247226b518, put_in_cache=true) at /test/mtest/11.0/sql/sql_connect.cc:1416
            #32 0x000056246e48fd75 in handle_one_connection (arg=0x562472249168) at /test/mtest/11.0/sql/sql_connect.cc:1318
            #33 0x000056246e99ef47 in pfs_spawn_thread (arg=0x5624721b3ac8) at /test/mtest/11.0/storage/perfschema/pfs.cc:2201
            #34 0x0000152e95528609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #35 0x0000152e950f9133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            ramesh Ramesh Sivaraman added a comment - The server also crashes when calling SP sys.optimizer_switch_on which creates a temporary table using the SEQUENCE engine. SET SESSION enforce_storage_engine= SEQUENCE ; CALL sys.optimizer_switch_on(); CALL sys.optimizer_switch_on();     11.0.1> SET SESSION enforce_storage_engine= SEQUENCE ; Query OK, 0 rows affected (0.000 sec)   11.0.1>CALL sys.optimizer_switch_on(); ERROR 1005 (HY000): Can't create table `sys`.`tmp_opt_switch` (errno: 131 "Command not supported by the engine" ) 11.0.1>CALL sys.optimizer_switch_on(); ERROR 2013 (HY000): Lost connection to server during query 11.0.1> Leads to 11.0.1 f9b33ac570337be320f718d52fd88d301a2bc1e7 mariadbd: /test/mtest/11.0/sql/sql_table.cc:12649: bool HA_CREATE_INFO::resolve_to_charset_collation_context(THD*, const Lex_table_charset_collation_attrs_st&, const Lex_table_charset_collation_attrs_st&, const Charset_collation_context&): Assertion `!default_table_charset || thd->stmt_arena->is_stmt_execute()' failed. 11.0.1 f9b33ac570337be320f718d52fd88d301a2bc1e7 Core was generated by `/test/mtest/mariadb-11.0.1-linux-x86_64-alter/bin/mariadbd --no-defaults --core'. Program terminated with signal SIGABRT, Aborted. #0 __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 [Current thread is 1 (Thread 0x152e80163700 (LWP 2541034))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000056246ef1e143 in my_write_core (sig=6) at /test/mtest/11.0/mysys/stacktrace.c:424 #2 0x000056246e688e0c in handle_fatal_signal (sig=6) at /test/mtest/11.0/sql/signal_handler.cc:357 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x0000152e94ffc859 in __GI_abort () at abort.c:79 #6 0x0000152e94ffc729 in __assert_fail_base (fmt=0x152e95192588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x56246f096358 "!default_table_charset || thd->stmt_arena->is_stmt_execute()", file=0x56246f093040 "/test/mtest/11.0/sql/sql_table.cc", line=12649, function=<optimized out>) at assert.c:92 #7 0x0000152e9500dfd6 in __GI___assert_fail (assertion=0x56246f096358 "!default_table_charset || thd->stmt_arena->is_stmt_execute()", file=0x56246f093040 "/test/mtest/11.0/sql/sql_table.cc", line=12649, function=0x56246f096398 "bool HA_CREATE_INFO::resolve_to_charset_collation_context(THD*, const Lex_table_charset_collation_attrs_st&, const Lex_table_charset_collation_attrs_st&, const Charset_collation_context&)") at assert.c:101 #8 0x000056246e3e5a45 in HA_CREATE_INFO::resolve_to_charset_collation_context (this=0x152e3805aac0, thd=0x152e38000db8, default_cscl_arg=@0x152e3805ad08: {<Lex_opt_context_charset_st> = {m_had_charset_default = false}, <Lex_exact_charset_extended_collation_attrs_st> = {m_ci = 0x56246fbc1800 <my_charset_latin1>, m_type = Lex_exact_charset_extended_collation_attrs_st::TYPE_CHARACTER_SET}, m_charset_order = Lex_extended_charset_extended_collation_attrs_st::CHARSET_TYPE_EXACT}, convert_cscl=@0x152e3805ad20: {<Lex_opt_context_charset_st> = {m_had_charset_default = false}, <Lex_exact_charset_extended_collation_attrs_st> = {m_ci = 0x0, m_type = Lex_exact_charset_extended_collation_attrs_st::TYPE_EMPTY}, m_charset_order = Lex_extended_charset_extended_collation_attrs_st::CHARSET_TYPE_EMPTY}, ctx=@0x152e8015ef10: {m_charset_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>, m_with_collate = false}, m_collate_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>}}) at /test/mtest/11.0/sql/sql_table.cc:12649 #9 0x000056246e2c2e21 in Table_specification_st::resolve_to_charset_collation_context (this=0x152e3805aac0, thd=0x152e38000db8, ctx=@0x152e8015ef10: {m_charset_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>, m_with_collate = false}, m_collate_default = {m_ci = 0x56246fd20f60 <my_charset_utf8mb3_general_ci>}}) at /test/mtest/11.0/sql/handler.h:2395 #10 0x000056246e3e4afa in Sql_cmd_create_table_like::execute (this=0x152e380484a0, thd=0x152e38000db8) at /test/mtest/11.0/sql/sql_table.cc:12321 #11 0x000056246e2b6a7f in mysql_execute_command (thd=0x152e38000db8, is_called_from_prepared_stmt=false) at /test/mtest/11.0/sql/sql_parse.cc:6001 #12 0x000056246e1a8f6b in sp_instr_stmt::exec_core (this=0x152e3804d048, thd=0x152e38000db8, nextp=0x152e8015f9fc) at /test/mtest/11.0/sql/sp_head.cc:3857 #13 0x000056246e1a827c in sp_lex_keeper::reset_lex_and_exec_core (this=0x152e3804d090, thd=0x152e38000db8, nextp=0x152e8015f9fc, open_tables=false, instr=0x152e3804d048) at /test/mtest/11.0/sql/sp_head.cc:3582 #14 0x000056246e1a8b0f in sp_instr_stmt::execute (this=0x152e3804d048, thd=0x152e38000db8, nextp=0x152e8015f9fc) at /test/mtest/11.0/sql/sp_head.cc:3763 #15 0x000056246e1a1dc3 in sp_head::execute (this=0x152e380465f0, thd=0x152e38000db8, merge_da_on_success=true) at /test/mtest/11.0/sql/sp_head.cc:1459 #16 0x000056246e1a4a80 in sp_head::execute_procedure (this=0x152e380465f0, thd=0x152e38000db8, args=0x152e3803d650) at /test/mtest/11.0/sql/sp_head.cc:2446 #17 0x000056246e2ac16b in do_execute_sp (thd=0x152e38000db8, sp=0x152e380465f0) at /test/mtest/11.0/sql/sql_parse.cc:3026 #18 0x000056246e2acdc5 in Sql_cmd_call::execute (this=0x152e3803a620, thd=0x152e38000db8) at /test/mtest/11.0/sql/sql_parse.cc:3271 #19 0x000056246e2b6a7f in mysql_execute_command (thd=0x152e38000db8, is_called_from_prepared_stmt=false) at /test/mtest/11.0/sql/sql_parse.cc:6001 #20 0x000056246e1a8f6b in sp_instr_stmt::exec_core (this=0x152e3803a8b0, thd=0x152e38000db8, nextp=0x152e80160efc) at /test/mtest/11.0/sql/sp_head.cc:3857 #21 0x000056246e1a827c in sp_lex_keeper::reset_lex_and_exec_core (this=0x152e3803a8f8, thd=0x152e38000db8, nextp=0x152e80160efc, open_tables=false, instr=0x152e3803a8b0) at /test/mtest/11.0/sql/sp_head.cc:3582 #22 0x000056246e1a8b0f in sp_instr_stmt::execute (this=0x152e3803a8b0, thd=0x152e38000db8, nextp=0x152e80160efc) at /test/mtest/11.0/sql/sp_head.cc:3763 #23 0x000056246e1a1dc3 in sp_head::execute (this=0x152e380391a0, thd=0x152e38000db8, merge_da_on_success=true) at /test/mtest/11.0/sql/sp_head.cc:1459 #24 0x000056246e1a4a80 in sp_head::execute_procedure (this=0x152e380391a0, thd=0x152e38000db8, args=0x152e38006138) at /test/mtest/11.0/sql/sp_head.cc:2446 #25 0x000056246e2ac16b in do_execute_sp (thd=0x152e38000db8, sp=0x152e380391a0) at /test/mtest/11.0/sql/sql_parse.cc:3026 #26 0x000056246e2acdc5 in Sql_cmd_call::execute (this=0x152e38013f78, thd=0x152e38000db8) at /test/mtest/11.0/sql/sql_parse.cc:3271 #27 0x000056246e2b6a7f in mysql_execute_command (thd=0x152e38000db8, is_called_from_prepared_stmt=false) at /test/mtest/11.0/sql/sql_parse.cc:6001 #28 0x000056246e2bcafc in mysql_parse (thd=0x152e38000db8, rawbuf=0x152e38013e90 "CALL sys.optimizer_switch_on()", length=30, parser_state=0x152e80162310) at /test/mtest/11.0/sql/sql_parse.cc:8000 #29 0x000056246e2a8f7f in dispatch_command (command=COM_QUERY, thd=0x152e38000db8, packet=0x152e3800b939 "CALL sys.optimizer_switch_on()", packet_length=30, blocking=true) at /test/mtest/11.0/sql/sql_parse.cc:1894 #30 0x000056246e2a793e in do_command (thd=0x152e38000db8, blocking=true) at /test/mtest/11.0/sql/sql_parse.cc:1407 #31 0x000056246e490019 in do_handle_one_connection (connect=0x56247226b518, put_in_cache=true) at /test/mtest/11.0/sql/sql_connect.cc:1416 #32 0x000056246e48fd75 in handle_one_connection (arg=0x562472249168) at /test/mtest/11.0/sql/sql_connect.cc:1318 #33 0x000056246e99ef47 in pfs_spawn_thread (arg=0x5624721b3ac8) at /test/mtest/11.0/storage/perfschema/pfs.cc:2201 #34 0x0000152e95528609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #35 0x0000152e950f9133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            bar Alexander Barkov added a comment - - edited

            This script also crashes the server:

            DROP DATABASE IF EXISTS db;
            DROP PROCEDURE IF EXISTS p;
            CREATE DATABASE db1;
            CREATE PROCEDURE p() CREATE DATABASE db1 COLLATE DEFAULT;
            --error ER_DB_CREATE_EXISTS
            CALL p;
            --error ER_DB_CREATE_EXISTS
            CALL p;
            

            So does this:

            DROP TABLE IF EXISTS t1;
            DROP PROCEDURE IF EXISTS p;
            CREATE TABLE t1 (a INT);
            CREATE PROCEDURE p() CREATE TABLE t1 (a INT) COLLATE DEFAULT;
            --error ER_TABLE_EXISTS_ERROR
            CALL p;
            --error ER_TABLE_EXISTS_ERROR
            CALL p;
            

            bar Alexander Barkov added a comment - - edited This script also crashes the server: DROP DATABASE IF EXISTS db; DROP PROCEDURE IF EXISTS p; CREATE DATABASE db1; CREATE PROCEDURE p() CREATE DATABASE db1 COLLATE DEFAULT ; --error ER_DB_CREATE_EXISTS CALL p; --error ER_DB_CREATE_EXISTS CALL p; So does this: DROP TABLE IF EXISTS t1; DROP PROCEDURE IF EXISTS p; CREATE TABLE t1 (a INT ); CREATE PROCEDURE p() CREATE TABLE t1 (a INT ) COLLATE DEFAULT ; --error ER_TABLE_EXISTS_ERROR CALL p; --error ER_TABLE_EXISTS_ERROR CALL p;

            People

              bar Alexander Barkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.