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

sql_mode=ORACLE: Add support for database qualified sequence names in NEXTVAL and CURRVAL

    XMLWordPrintable

Details

    Description

      The SQL standard syntax for NEXT VALUE FOR works for both non-qualified and qualified sequence names:

      SET sql_mode=ORACLE;
      DROP SEQUENCE IF EXISTS s1;
      CREATE SEQUENCE s1;
      SELECT NEXT VALUE FOR s1;
      SELECT s1.nextval;
      

      +-------------------+
      | NEXT VALUE FOR s1 |
      +-------------------+
      |                 1 |
      +-------------------+
      +------------+
      | s1.nextval |
      +------------+
      |          2 |
      +------------+
      

      SELECT NEXT VALUE FOR test.s1;
      

      +------------------------+
      | NEXT VALUE FOR test.s1 |
      +------------------------+
      |                      3 |
      +------------------------+
      

      Qualified sequence names also work with IBM DB2 syntax for PREVIOUS VALUE FOR

      SELECT PREVIOUS VALUE FOR test.s1;
      

      +----------------------------+
      | PREVIOUS VALUE FOR test.s1 |
      +----------------------------+
      |                          3 |
      +----------------------------+
      

      Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work:

      SELECT test.s1.nextval;
      

      SELECT test.s1.currval;
      

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 3h
                  3h

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.