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

Default parameter value type mismatch should be handled at creation time

    XMLWordPrintable

Details

    Description

      Currently we are allowing setting a not matching data type value in a stored routine parameter default value. The error is caught when we invoke the routine at the run time. Ideally it should be handled at the creation time itself as it's done for CREATE TABLE.

      Repro
      ------

      11.8.0-opt>DELIMITER $$
      11.8.0-opt>CREATE OR REPLACE PROCEDURE sp1(p1 INT DEFAULT 'x') BEGIN SELECT p1 FROM DUAL; END $$
      Query OK, 0 rows affected (0.006 sec)
       
      11.8.0-opt>DELIMITER ;
      11.8.0-opt>CALL sp1();
      ERROR 1366 (22007): Incorrect integer value: 'x' for column ``.``.`p1` at row 0
      

      Expected behavior:
      It should be similar to table creation.

      11.8.0-opt>CREATE TABLE t2 (i INT DEFAULT 'x');
      ERROR 1067 (42000): Invalid default value for 'i'
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              susil.behera Susil Behera
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.