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

            sanja Oleksandr Byelkin created issue -
            sanja Oleksandr Byelkin made changes -
            Field Original Value New Value
            sanja Oleksandr Byelkin made changes -

            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
            sanja Oleksandr Byelkin made changes -
            Affects Version/s 10.5 [ 23123 ]
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]

            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)
            sanja Oleksandr Byelkin made changes -
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]

            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)"
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Ian Gilfillan [ greenman ]
            sanja Oleksandr Byelkin made changes -
            Status Open [ 1 ] Confirmed [ 10101 ]
            sanja Oleksandr Byelkin made changes -
            Assignee Ian Gilfillan [ greenman ] Oleksandr Byelkin [ sanja ]
            sanja Oleksandr Byelkin made changes -
            Status Confirmed [ 10101 ] In Progress [ 3 ]

            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.
            sanja Oleksandr Byelkin made changes -
            Assignee Oleksandr Byelkin [ sanja ] Sergei Golubchik [ serg ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Oleksandr Byelkin [ sanja ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            sanja Oleksandr Byelkin made changes -
            Component/s OTHER [ 10125 ]
            Component/s Stored routines [ 13905 ]
            Fix Version/s 10.4.15 [ 24507 ]
            Fix Version/s 10.5.6 [ 24508 ]
            Fix Version/s 10.4 [ 22408 ]
            Fix Version/s 10.5 [ 23123 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.5.7 [ 25019 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.5.6 [ 24508 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4.16 [ 25020 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.4.15 [ 24507 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 112745 ] MariaDB v4 [ 158263 ]
            mariadb-jira-automation Jira Automation (IT) made changes -
            Zendesk Related Tickets 147573

            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.