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

Crash when EXPLAIN SELECT .. INTO row_sp_variable.field

    XMLWordPrintable

Details

    Description

      This script make the server crash in debug builds:

      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE a ROW(a INT);
        EXPLAIN SELECT 1 INTO a.a;
      END;
      $$
      DELIMITER ;
      

      with this stack trace:

      #0  0x00007ffff5bcfa28 in raise () from /lib64/libc.so.6
      #1  0x00007ffff5bd162a in abort () from /lib64/libc.so.6
      #2  0x00007ffff5bc8227 in __assert_fail_base () from /lib64/libc.so.6
      #3  0x00007ffff5bc82d2 in __assert_fail () from /lib64/libc.so.6
      #4  0x0000555555b93179 in parse_sql (thd=0x7ffe6c000a98, 
          parser_state=0x7ffff0c1e140, creation_ctx=0x0, do_pfs_digest=true)
          at /home/bar/maria-git/server.10.2-ext/sql/sql_parse.cc:9931
      #5  0x0000555555b8e50e in mysql_parse (thd=0x7ffe6c000a98, 
          rawbuf=0x7ffe6c0113b0 "BEGIN NOT ATOMIC\n  DECLARE a ROW(a INT);\n  EXPLAIN SELECT 1 INTO a.a;\nEND", length=73, parser_state=0x7ffff0c1e140, 
          is_com_multi=false, is_next_command=false)
          at /home/bar/maria-git/server.10.2-ext/sql/sql_parse.cc:7839
      #6  0x0000555555b7c2dd in dispatch_command (command=COM_QUERY, 
          thd=0x7ffe6c000a98, 
          packet=0x7ffe6c007f99 "BEGIN NOT ATOMIC\n  DECLARE a ROW(a INT);\n  EXPLAIN SELECT 1 INTO a.a;\nEND;", packet_length=74, is_com_multi=false, 
          is_next_command=false)
          at /home/bar/maria-git/server.10.2-ext/sql/sql_parse.cc:1814
      

      The same crash happens with Oracle syntax:

      SET sql_mode=ORACLE;
      DELIMITER $$
      DECLARE
        a ROW(a INT);
      BEGIN
        EXPLAIN SELECT 1 INTO a.a;
      END;
      $$
      DELIMITER ;
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.