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

Syntax error in ond SP results in misleading message on SHOW CREATE PROCEDURE

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.4(EOL), 10.5
    • 10.4.16, 10.5.7
    • OTHER
    • None

    Description

      DELIMITER $$;
       
      CREATE PROCEDURE P1 ()
      BEGIN NOT ATOMIC
        IF (SELECT 2) THEN
          SELECT 4;
        END IF ;
      END;
      $$
       
      DELIMITER ;$$
       
      select name,db,body from mysql.proc where name = "P1";
      update mysql.proc set body_utf8="BEGIN NOT ATOMIC
      IF (SELECT 2) OR foo = 3 THEN
      SELECT 4;
      END IF ;
      END", body="BEGIN NOT ATOMIC
      IF (SELECT 2) OR foo = 3 THEN
      SELECT 4;
      END IF ;
      END"where name = "P1";
       
      show create procedure P1;
       
      drop procedure P1;
      

      mysqltest: At line 25: query 'show create procedure P1' failed: 1457: Failed to load routine test.P1. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6)
      

      Attachments

        Issue Links

          Activity

            instead of checking parser error on opening procedure, we shoud check sqlstate "42000".

            use mysql_errno_to_sqlstate probably to convert

            sanja Oleksandr Byelkin added a comment - instead of checking parser error on opening procedure, we shoud check sqlstate "42000". use mysql_errno_to_sqlstate probably to convert

            the test case is repetable on 10.4 + due to syntax error (probably it is possible to find other errors in earlier versions)

            sanja Oleksandr Byelkin added a comment - the test case is repetable on 10.4 + due to syntax error (probably it is possible to find other errors in earlier versions)

            it is unrelated to real parsing error, so just an error text shoud be changed to show posibility of parsing error of old SP:

            Something like "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data or stored procedure text from old version has an sytax error (internal code %d)"

            sanja Oleksandr Byelkin added a comment - it is unrelated to real parsing error, so just an error text shoud be changed to show posibility of parsing error of old SP: Something like "Failed to load routine %-.192s. The table mysql.proc is missing, corrupt, or contains bad data or stored procedure text from old version has an sytax error (internal code %d)"

            ommit 6f211b1f01b51e8d335fe90b227536fdfc034591 (HEAD > bb-10.4MDEV-23518, origin/bb-10.4-MDEV-23518)
            Author: Oleksandr Byelkin <sanja@mariadb.com>
            Date: Fri Aug 28 16:05:38 2020 +0200

            MDEV-23518 Syntax error in ond SP results in misleading message on SHOW CREATE PROCEDURE

            Add info to the error message how to get details about error which happened.

            sanja Oleksandr Byelkin added a comment - ommit 6f211b1f01b51e8d335fe90b227536fdfc034591 (HEAD > bb-10.4 MDEV-23518 , origin/bb-10.4- MDEV-23518 ) Author: Oleksandr Byelkin <sanja@mariadb.com> Date: Fri Aug 28 16:05:38 2020 +0200 MDEV-23518 Syntax error in ond SP results in misleading message on SHOW CREATE PROCEDURE Add info to the error message how to get details about error which happened.

            People

              sanja Oleksandr Byelkin
              sanja Oleksandr Byelkin
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.