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

crash with execute immediate in SP

    XMLWordPrintable

Details

    Description

      CREATE DATABASE pf;
      CREATE DATABASE udb;
       
      delimiter //;
      create definer=root@localhost procedure pf.p2d(x int)
      begin
        set @got = x;
        execute immediate 'set @z = 9';
      end//
      create definer=root@localhost function udb.f_uc(x int) returns int(11)
          deterministic
      begin
        call pf.p2d(x);
        return 0;
      end//
      delimiter ;//
       
      create user uc@localhost;
      grant insert, create on udb.*  to uc@localhost;
      grant execute on procedure pf.p2d to uc@localhost;
      grant execute on function udb.f_uc to uc@localhost;
       
      connect uc,localhost,uc;
      use udb;
      create table ctuc as select f_uc(1) as c1;
      

      /home/serg/Abk/mysql/sql/mariadbd(my_print_stacktrace+0x40) [0x55a929c8475a]
      /home/serg/Abk/mysql/sql/mariadbd(handle_fatal_signal+0x285) [0x55a92918638c]
      libc_sigaction.c:0(__restore_rt)[0x7f360da89e30]
      sql/sql_class.h:5283(THD::is_error() const)[0x55a928aa6e2e]
      sql/item.cc:7583(Item::save_in_field(Field*, bool))[0x55a9291c97ac]
      sql/sql_base.cc:9884(fill_record(THD*, TABLE*, Field**, List<Item>&, bool, bool, bool))[0x55a928b87c86]
      sql/sql_base.cc:9943(fill_record_n_invoke_before_triggers(THD*, TABLE*, Field**, List<Item>&, bool, trg_event_type, bool*))[0x55a928b87ead]
      sql/sql_insert.cc:5430(select_create::store_values(List<Item>&, bool*))[0x55a928bfa952]
      sql/sql_insert.cc:4519(select_insert::send_data(List<Item>&))[0x55a928bf773d]
      sql/sql_class.cc:3379(select_result_sink::send_data_with_check(List<Item>&, st_select_lex_unit*, unsigned long long))[0x55a928bad500]
      sql/sql_select.cc:5009(JOIN::exec_inner())[0x55a928ce7339]
      sql/sql_select.cc:4928(JOIN::exec())[0x55a928ce6c2e]
      sql/sql_select.cc:5454(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*))[0x55a928ce85e4]
      sql/sql_select.cc:651(handle_select(THD*, LEX*, select_result*, unsigned long long))[0x55a928cd5605]
      sql/sql_table.cc:13861(Sql_cmd_create_table_like::execute(THD*))[0x55a928dd134d]
      sql/sql_parse.cc:5947(mysql_execute_command(THD*, bool))[0x55a928c632cb]
      sql/sql_parse.cc:8005(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x55a928c69c36]
      sql/sql_parse.cc:1905(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool))[0x55a928c5464d]
      sql/sql_parse.cc:1437(do_command(THD*, bool))[0x55a928c52df9]
      sql/sql_connect.cc:1514(do_handle_one_connection(CONNECT*, bool))[0x55a928ea5a74]
      sql/sql_connect.cc:1428(handle_one_connection)[0x55a928ea57f5]
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              serg Sergei Golubchik
              Alexander Barkov Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 0.5d
                  0.5d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

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