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

Support for default values for PL/SQL procedure / function

    XMLWordPrintable

Details

    Description

      Oracle PL/SQL supports default values for parameters to procedures and functions, which is not supported by SQL/PL in MariaDB. This is a commonly used PL/SQL feature and looks like this, this works fine with Oracle but doesn't compile with MariaDB (excluding SQL_MODE and delimiter, obviously):

      SET SQL_MODE=Oracle;
      delimiter //
       
      CREATE OR REPLACE PROCEDURE p1(a1 INTEGER := 1)
      IS
         dummy INTEGER;
      BEGIN
         SELECT a1 INTO dummy FROM dual;
      END;
      //
       
      CREATE OR REPLACE FUNCTION f1(a1 INTEGER := 1)
      RETURN INTEGER
      IS
      BEGIN
         RETURN a1;
      END;
      //

      Attachments

        Activity

          People

            Unassigned Unassigned
            karlsson Anders Karlsson
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.