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

Default parameter out of range values should be handled at creation time

    XMLWordPrintable

Details

    Description

      Currently we are allowing setting an out of range value in a stored routine default parameter. 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 outofrange_test_2(p1 TINYINT UNSIGNED DEFAULT -1)
          -> BEGIN
          -> SELECT p1;
          -> END $$
      Query OK, 0 rows affected (0.004 sec)
       
      11.8.0-opt>DELIMITER ;
      11.8.0-opt>CALL outofrange_test_2();
      ERROR 1264 (22003): Out of range value for column 'p1' at row 0
      11.8.0-opt>
      

      Expected behavior:
      It should be similar to table creation.

      11.8.0-opt>CREATE TABLE t1 (c1 INT UNSIGNED DEFAULT -1);
      ERROR 1067 (42000): Invalid default value for 'c1'
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              susil.behera Susil Behera
              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.