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

    XMLWordPrintable

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

            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.