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

sql_error_log plugin logs errors caught by procedure handler

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2, 10.3, 10.4, 10.5
    • Fix Version/s: 10.2, 10.3, 10.4, 10.5
    • Component/s: Plugins
    • Labels:
      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

            Assignee:
            sanja Oleksandr Byelkin
            Reporter:
            hholzgra Hartmut Holzgraefe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: