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

sql_error_log plugin logs errors caught by procedure handler

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Won't Fix
    • 10.2, 10.3, 10.4, 10.5
    • N/A
    • Plugins
    • None

    Description

      When having the sql-error-log plugin enabled, and running a simple procedure test fetching data from a cursor, the following is written to the sql error plugin log, even though a HANDLER for NOT FOUND exists to catch this error, so that it is never actually returned to the client at all:

      Error 1329: No data - zero rows fetched, selected, or processed ....
      

      Looks as if the plugin API event that the sql error log plugin hooks into fires before the procedures HANDLER even has a chance to actually act on the error ...

      CREATE TABLE t1(i INT);
       
      DELIMITER //
       
      CREATE PROCEDURE p1()
      BEGIN
        DECLARE done INT DEFAULT FALSE;
        DECLARE x INT;
        DECLARE cur1 CURSOR FOR SELECT i FROM t1;
        DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
       
        OPEN cur1;
       
        read_loop: LOOP
          FETCH cur1 INTO x;
          IF done THEN
            LEAVE read_loop;
          END IF;
        END LOOP;
       
        CLOSE cur1;
      END; //
       
      DELIMITER ;
       
      CALL p1();
      

      Attachments

        Activity

          People

            serg Sergei Golubchik
            hholzgra Hartmut Holzgraefe
            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.