Details
-
Technical task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
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
- relates to
-
MDEV-10139 Support for SEQUENCE objects
-
- Closed
-
-
MDEV-12883 CREATE SEQUENCE with huge MAXVALUE
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Parent |
|
|
Issue Type | Task [ 3 ] | Technical task [ 7 ] |
Description |
The SQL standard syntax for {{NEXT VALUE FOR}} and {{PREVIOUS VALUE FOR}} works for both non-qualified and qualified sequence names:
{code:sql} SET sql_mode=ORACLE; DROP SEQUENCE IF EXISTS s1; CREATE SEQUENCE s1; SELECT NEXT VALUE FOR s1; SELECT s1.nextval; {code} {noformat} +-------------------+ | NEXT VALUE FOR s1 | +-------------------+ | 1 | +-------------------+ +------------+ | s1.nextval | +------------+ | 2 | +------------+ {noformat} {code:sql} SELECT NEXT VALUE FOR test.s1; {code} {noformat} +------------------------+ | NEXT VALUE FOR test.s1 | +------------------------+ | 3 | +------------------------+ {noformat} Looks good. Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work: {code:sql} SELECT test.s1.nextval; {code} {noformat} {code:sql} SELECT test.s1.currval; {code} |
The SQL standard syntax for {{NEXT VALUE FOR}} and {{PREVIOUS VALUE FOR}} works for both non-qualified and qualified sequence names:
{code:sql} SET sql_mode=ORACLE; DROP SEQUENCE IF EXISTS s1; CREATE SEQUENCE s1; SELECT NEXT VALUE FOR s1; SELECT s1.nextval; {code} {noformat} +-------------------+ | NEXT VALUE FOR s1 | +-------------------+ | 1 | +-------------------+ +------------+ | s1.nextval | +------------+ | 2 | +------------+ {noformat} {code:sql} SELECT NEXT VALUE FOR test.s1; {code} {noformat} +------------------------+ | NEXT VALUE FOR test.s1 | +------------------------+ | 3 | +------------------------+ {noformat} Qualified sequence names also work with IBM DB2 syntax for {{PREVIOUS VALUE FOR}} {code:sql} SELECT PREVIOUS VALUE FOR test.s1; {code} {noformat} +----------------------------+ | PREVIOUS VALUE FOR test.s1 | +----------------------------+ | 3 | +----------------------------+ {noformat} Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work: {code:sql} SELECT test.s1.nextval; {code} {noformat} {code:sql} SELECT test.s1.currval; {code} |
Description |
The SQL standard syntax for {{NEXT VALUE FOR}} and {{PREVIOUS VALUE FOR}} works for both non-qualified and qualified sequence names:
{code:sql} SET sql_mode=ORACLE; DROP SEQUENCE IF EXISTS s1; CREATE SEQUENCE s1; SELECT NEXT VALUE FOR s1; SELECT s1.nextval; {code} {noformat} +-------------------+ | NEXT VALUE FOR s1 | +-------------------+ | 1 | +-------------------+ +------------+ | s1.nextval | +------------+ | 2 | +------------+ {noformat} {code:sql} SELECT NEXT VALUE FOR test.s1; {code} {noformat} +------------------------+ | NEXT VALUE FOR test.s1 | +------------------------+ | 3 | +------------------------+ {noformat} Qualified sequence names also work with IBM DB2 syntax for {{PREVIOUS VALUE FOR}} {code:sql} SELECT PREVIOUS VALUE FOR test.s1; {code} {noformat} +----------------------------+ | PREVIOUS VALUE FOR test.s1 | +----------------------------+ | 3 | +----------------------------+ {noformat} Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work: {code:sql} SELECT test.s1.nextval; {code} {noformat} {code:sql} SELECT test.s1.currval; {code} |
The SQL standard syntax for {{NEXT VALUE FOR}} works for both non-qualified and qualified sequence names:
{code:sql} SET sql_mode=ORACLE; DROP SEQUENCE IF EXISTS s1; CREATE SEQUENCE s1; SELECT NEXT VALUE FOR s1; SELECT s1.nextval; {code} {noformat} +-------------------+ | NEXT VALUE FOR s1 | +-------------------+ | 1 | +-------------------+ +------------+ | s1.nextval | +------------+ | 2 | +------------+ {noformat} {code:sql} SELECT NEXT VALUE FOR test.s1; {code} {noformat} +------------------------+ | NEXT VALUE FOR test.s1 | +------------------------+ | 3 | +------------------------+ {noformat} Qualified sequence names also work with IBM DB2 syntax for {{PREVIOUS VALUE FOR}} {code:sql} SELECT PREVIOUS VALUE FOR test.s1; {code} {noformat} +----------------------------+ | PREVIOUS VALUE FOR test.s1 | +----------------------------+ | 3 | +----------------------------+ {noformat} Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work: {code:sql} SELECT test.s1.nextval; {code} {noformat} {code:sql} SELECT test.s1.currval; {code} |
Description |
The SQL standard syntax for {{NEXT VALUE FOR}} works for both non-qualified and qualified sequence names:
{code:sql} SET sql_mode=ORACLE; DROP SEQUENCE IF EXISTS s1; CREATE SEQUENCE s1; SELECT NEXT VALUE FOR s1; SELECT s1.nextval; {code} {noformat} +-------------------+ | NEXT VALUE FOR s1 | +-------------------+ | 1 | +-------------------+ +------------+ | s1.nextval | +------------+ | 2 | +------------+ {noformat} {code:sql} SELECT NEXT VALUE FOR test.s1; {code} {noformat} +------------------------+ | NEXT VALUE FOR test.s1 | +------------------------+ | 3 | +------------------------+ {noformat} Qualified sequence names also work with IBM DB2 syntax for {{PREVIOUS VALUE FOR}} {code:sql} SELECT PREVIOUS VALUE FOR test.s1; {code} {noformat} +----------------------------+ | PREVIOUS VALUE FOR test.s1 | +----------------------------+ | 3 | +----------------------------+ {noformat} Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work: {code:sql} SELECT test.s1.nextval; {code} {noformat} {code:sql} SELECT test.s1.currval; {code} |
The SQL standard syntax for {{NEXT VALUE FOR}} works for both non-qualified and qualified sequence names:
{code:sql} SET sql_mode=ORACLE; DROP SEQUENCE IF EXISTS s1; CREATE SEQUENCE s1; SELECT NEXT VALUE FOR s1; SELECT s1.nextval; {code} {noformat} +-------------------+ | NEXT VALUE FOR s1 | +-------------------+ | 1 | +-------------------+ +------------+ | s1.nextval | +------------+ | 2 | +------------+ {noformat} {code:sql} SELECT NEXT VALUE FOR test.s1; {code} {noformat} +------------------------+ | NEXT VALUE FOR test.s1 | +------------------------+ | 3 | +------------------------+ {noformat} Qualified sequence names also work with IBM DB2 syntax for {{PREVIOUS VALUE FOR}} {code:sql} SELECT PREVIOUS VALUE FOR test.s1; {code} {noformat} +----------------------------+ | PREVIOUS VALUE FOR test.s1 | +----------------------------+ | 3 | +----------------------------+ {noformat} Under terms of this task we'll add support for qualified sequence names for Oracle syntax, to make these queries work: {code:sql} SELECT test.s1.nextval; {code} {code:sql} SELECT test.s1.currval; {code} |
Summary | Add support for database qualified sequence names in NEXTVAL and CURRVAL | sql_mode=ORACLE: Add support for database qualified sequence names in NEXTVAL and CURRVAL |
Labels | Compatibility |
Link |
This issue relates to |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Assignee | Alexander Barkov [ bar ] |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
Component/s | Parser [ 10201 ] | |
Fix Version/s | 10.3.1 [ 22532 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Link |
This issue relates to |
Workflow | MariaDB v3 [ 80381 ] | MariaDB v4 [ 151973 ] |
Pushed to bb-10.2-ext, 10.3, bb-10.2-compatibility.