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

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

      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

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

                Dates

                Created:
                Updated:
                Resolved: