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

Error 1370 not handled in stored procedures

    XMLWordPrintable

Details

    Description

      In the following example error 1370 is ok, but I'm trying to handle it, and this seems to be impossible.

      MariaDB [test]> CREATE USER u2;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [test]> DELIMITER ||
      MariaDB [test]> CREATE DEFINER = u2 PROCEDURE p()
          -> SQL SECURITY DEFINER
          -> BEGIN
          -> DECLARE EXIT HANDLER
          -> FOR 1370
          -> SELECT 1370 AS `ERROR`;
          -> DECLARE EXIT HANDLER
          -> FOR SQLSTATE '42000'
          -> SELECT '42000' AS `ERROR`;
          -> SHOW PROCESSLIST;
          -> SELECT 'OK';
          -> END;
          -> ||
      Query OK, 0 rows affected (0.03 sec)
       
      MariaDB [test]> DELIMITER ;
      MariaDB [test]> CALL p();
      ERROR 1370 (42000): execute command denied to user 'u2'@'%' for routine 'test.p'

      Attachments

        Activity

          People

            elenst Elena Stepanova
            f_razzoli Federico Razzoli
            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.