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

Unexpected syntax error instead of "Unknown system variable" inside an SP

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.1, 10.2, 10.3
    • 10.3.6
    • Stored routines
    • None
    • 10.3.6-1

    Description

      I run this script, it correctly returns an "Unknown system variable" error:

      DELIMITER $$
      BEGIN NOT ATOMIC
        SET GLOBAL a=10;
      END;
      $$
      DELIMITER ;
      

      ERROR 1193 (HY000): Unknown system variable 'a'
      

      Now I modify the script slightly: additionally declare a local variable with name a:

      DELIMITER $$
      BEGIN NOT ATOMIC
        DECLARE a INT;
        SET GLOBAL a=10;
      END;
      $$
      DELIMITER ;
      

      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ';
      

      The error message looks confusing. The expected error message would be to return "Unknown system variable".

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              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.