Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-10142 PL/SQL parser
  3. MDEV-10598

sql_mode=ORACLE: Variable declarations can go after cursor declarations

    XMLWordPrintable

Details

    • 10.2.2-3, 10.2.2-1, 10.2.2-2, 10.2.2-4, 10.1.18

    Description

      In MariaDB variable declarations cannot go after cursor declarations.

      In Oracle there is no such restriction:

      DROP TABLE t1;
      DROP FUNCTION f1;
      CREATE TABLE t1 (a INT);
      INSERT INTO t1 VALUES (1);
      CREATE FUNCTION f1 RETURN INT
      AS
        CURSOR c IS SELECT a FROM t1;
        v_a INT;
      BEGIN
        OPEN c;
        FETCH c INTO v_a;
        CLOSE c;
        RETURN v_a;
      EXCEPTION
        WHEN OTHERS THEN RETURN -1;
      END;
      /
      SELECT f1() FROM DUAL;
      

            F1()
      ----------
      	 1
      

      Attachments

        Issue Links

          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.