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

OUT and INOUT parameters shouldn't expect a default value

Details

    Description

      Default value for OUT and INOUT parameters in a stored procedure is not supported. But when an OUT or INOUT parameter is supplied along with an IN parameter with a default value we error out expecting the same for OUT or INOUT parameter.

      Repro:

      11.8.0-opt>DELIMITER $$
      11.8.0-opt>CREATE OR REPLACE PROCEDURE sp1(IN p1 INT DEFAULT 0, OUT p2 INT DEFAULT 5) BEGIN SET p2 = p2 + 1; END$$
      ERROR 4032 (HY000): Default/ignore value is not supported for such parameter usage
       
      11.8.0-opt>CREATE OR REPLACE PROCEDURE sp1(IN p1 INT DEFAULT 0, OUT p2 INT) BEGIN SET p2 = p2 + 1; END$$
      ERROR 1230 (42000): Variable 'p2' doesn't have a default value
      11.8.0-opt>
      

      Expected behavior:
      The following CREATE PROCEDURE should succeed.

      CREATE OR REPLACE PROCEDURE sp1(IN p1 INT DEFAULT 0, OUT p2 INT) 
      

      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.