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

Stored function does not return warnings generated inside the function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.0, 10.1, 10.2.7
    • Fix Version/s: N/A
    • Environment:
      Operating System: CentOS Linux release 7.3.1611 (Core)
      Originally found on an Amazon EC2 Instance, with Plesk as the control panel for the server. MariaDB had been upgraded twice (from the CentOS's own version to 10.1 and then to 10.2)

      Description

      Note: This affects MySQL 5.7.19 as well (bug report 87442).

      When you have a function (e.g. f()) that uses SIGNAL SQLSTATE '01xxx' (where xxx is any three digits), then running SELECT f(); will return a success message (and the return value) or an error message, but in both cases will not return any warnings.

      Should you modify the function so it is a procedure (only changing CREATE FUNCTION to CREATE PROCEDURE and removing RETURNS <TYPE> and RETURN <return value>), then run CALL F(); the procedure will return a warning ONLY if the SIGNAL is the last line. (In a function it is impossible for the SIGNAL to be the last line, as you are required to have a RETURN.)

      Please see attached file for example function/procedures, and the results.

        Attachments

          Activity

            People

            Assignee:
            greenman Ian Gilfillan
            Reporter:
            rmhumphries Robert Humphries
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.