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

Assertion in Diagnostics_area::set_error_status when using a bad datetime with PS and SP

    XMLWordPrintable

Details

    • 10.2.12

    Description

      This script crashes the server in debug builds:

      DELIMITER $$
      CREATE OR REPLACE PROCEDURE p1(OUT a VARCHAR(20))
      BEGIN
        SET a=10;
      END;
      $$
      BEGIN NOT ATOMIC
        DECLARE a DATETIME;
        EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
      END;
      $$
      DELIMITER ;
      

      Note, if I slightly rewrite the script not to use dynamic SQL, the crash disappears and a correct error is returned instead:

      DELIMITER $$
      CREATE OR REPLACE PROCEDURE p1(OUT a VARCHAR(20))
      BEGIN
        SET a=10;
      END;
      $$
      BEGIN NOT ATOMIC
        DECLARE a DATETIME;
        CALL p1(a);
      END;
      $$
      DELIMITER ;
      

      ERROR 1292 (22007): Incorrect datetime value: '10' for column 'a' at row 1
      

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.