should be it
This commit is contained in:
31
external/duckdb/test/sql/catalog/sequence/sequence_cycle.test
vendored
Normal file
31
external/duckdb/test/sql/catalog/sequence/sequence_cycle.test
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# name: test/sql/catalog/sequence/sequence_cycle.test
|
||||
# description: Test Sequences with cycles
|
||||
# group: [sequence]
|
||||
|
||||
statement ok
|
||||
create sequence minseq INCREMENT BY -1 MINVALUE -5 MAXVALUE 5 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('minseq') from generate_series(0,20);
|
||||
----
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
0
|
||||
-1
|
||||
-2
|
||||
-3
|
||||
-4
|
||||
-5
|
||||
5
|
||||
4
|
||||
3
|
||||
2
|
||||
1
|
||||
0
|
||||
-1
|
||||
-2
|
||||
-3
|
||||
-4
|
||||
16
external/duckdb/test/sql/catalog/sequence/sequence_offset_increment.test
vendored
Normal file
16
external/duckdb/test/sql/catalog/sequence/sequence_offset_increment.test
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# name: test/sql/catalog/sequence/sequence_offset_increment.test
|
||||
# description: Issue #9252: Sequences defined with offset and custom increment always start with 1 instead of using the offset
|
||||
# group: [sequence]
|
||||
|
||||
statement ok
|
||||
create sequence xx start 100 increment by 2;
|
||||
|
||||
query I
|
||||
SELECT nextval('xx')
|
||||
----
|
||||
100
|
||||
|
||||
query I
|
||||
SELECT nextval('xx')
|
||||
----
|
||||
102
|
||||
119
external/duckdb/test/sql/catalog/sequence/sequence_overflow.test
vendored
Normal file
119
external/duckdb/test/sql/catalog/sequence/sequence_overflow.test
vendored
Normal file
@@ -0,0 +1,119 @@
|
||||
# name: test/sql/catalog/sequence/sequence_overflow.test
|
||||
# description: Issue #2678: overflow in sequences
|
||||
# group: [sequence]
|
||||
|
||||
statement ok
|
||||
create sequence seq1 INCREMENT BY 1 MINVALUE 9223372036854775800 MAXVALUE 9223372036854775807 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq1') from generate_series(0,20);
|
||||
----
|
||||
9223372036854775800
|
||||
9223372036854775801
|
||||
9223372036854775802
|
||||
9223372036854775803
|
||||
9223372036854775804
|
||||
9223372036854775805
|
||||
9223372036854775806
|
||||
9223372036854775807
|
||||
9223372036854775800
|
||||
9223372036854775801
|
||||
9223372036854775802
|
||||
9223372036854775803
|
||||
9223372036854775804
|
||||
9223372036854775805
|
||||
9223372036854775806
|
||||
9223372036854775807
|
||||
9223372036854775800
|
||||
9223372036854775801
|
||||
9223372036854775802
|
||||
9223372036854775803
|
||||
9223372036854775804
|
||||
|
||||
statement ok
|
||||
create sequence seq2 INCREMENT BY -1 MINVALUE -9223372036854775808 MAXVALUE -9223372036854775800 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq2') from generate_series(0,20);
|
||||
----
|
||||
-9223372036854775800
|
||||
-9223372036854775801
|
||||
-9223372036854775802
|
||||
-9223372036854775803
|
||||
-9223372036854775804
|
||||
-9223372036854775805
|
||||
-9223372036854775806
|
||||
-9223372036854775807
|
||||
-9223372036854775808
|
||||
-9223372036854775800
|
||||
-9223372036854775801
|
||||
-9223372036854775802
|
||||
-9223372036854775803
|
||||
-9223372036854775804
|
||||
-9223372036854775805
|
||||
-9223372036854775806
|
||||
-9223372036854775807
|
||||
-9223372036854775808
|
||||
-9223372036854775800
|
||||
-9223372036854775801
|
||||
-9223372036854775802
|
||||
|
||||
statement ok
|
||||
create sequence seq3 INCREMENT BY 1 MINVALUE 9223372036854775800 MAXVALUE 9223372036854775807;
|
||||
|
||||
statement error
|
||||
SELECT nextval('seq3') from generate_series(0,20);
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached maximum value of sequence.*
|
||||
|
||||
statement ok
|
||||
create sequence seq4 INCREMENT BY -1 MINVALUE -9223372036854775808 MAXVALUE -9223372036854775800;
|
||||
|
||||
statement error
|
||||
SELECT nextval('seq4') from generate_series(0,20);
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached minimum value of sequence.*
|
||||
|
||||
statement ok
|
||||
create sequence seq5 INCREMENT BY 9223372036854775807 MINVALUE 9223372036854775800 MAXVALUE 9223372036854775807 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq5') from generate_series(0,20);
|
||||
----
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
9223372036854775800
|
||||
|
||||
statement ok
|
||||
create sequence seq6 INCREMENT BY 9223372036854775807 MINVALUE 9223372036854775800 MAXVALUE 9223372036854775807;
|
||||
|
||||
statement error
|
||||
SELECT nextval('seq6') from generate_series(0,20);
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached maximum value of sequence.*
|
||||
|
||||
statement ok
|
||||
create sequence seq7 INCREMENT BY -9223372036854775808 MINVALUE -9223372036854775808 MAXVALUE -9223372036854775800;
|
||||
|
||||
statement error
|
||||
SELECT nextval('seq7') from generate_series(0,20);
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached minimum value of sequence.*
|
||||
17
external/duckdb/test/sql/catalog/sequence/test_duckdb_sequences.test
vendored
Normal file
17
external/duckdb/test/sql/catalog/sequence/test_duckdb_sequences.test
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# name: test/sql/catalog/sequence/test_duckdb_sequences.test
|
||||
# group: [sequence]
|
||||
|
||||
require noforcestorage
|
||||
|
||||
statement ok
|
||||
create sequence my_seq;
|
||||
|
||||
query I
|
||||
select nextval('my_seq');
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
select last_value from duckdb_sequences();
|
||||
----
|
||||
1
|
||||
560
external/duckdb/test/sql/catalog/sequence/test_sequence.test
vendored
Normal file
560
external/duckdb/test/sql/catalog/sequence/test_sequence.test
vendored
Normal file
@@ -0,0 +1,560 @@
|
||||
# name: test/sql/catalog/sequence/test_sequence.test
|
||||
# description: Test Sequences
|
||||
# group: [sequence]
|
||||
|
||||
# note: query verification is disabled for these queries
|
||||
# because running the same query multiple times with a sequence does not result in the same answer
|
||||
# create a sequence
|
||||
|
||||
require skip_reload
|
||||
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE seq;
|
||||
|
||||
# cannot create duplicate sequence
|
||||
statement error
|
||||
CREATE SEQUENCE seq;
|
||||
----
|
||||
<REGEX>:.*Catalog Error.*already exists.*
|
||||
|
||||
# ignore errors if sequence already exists
|
||||
statement ok
|
||||
CREATE SEQUENCE IF NOT EXISTS seq;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
# replace sequence
|
||||
statement ok
|
||||
CREATE OR REPLACE SEQUENCE seq
|
||||
|
||||
# generate values from the sequence
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
query II
|
||||
SELECT nextval('seq'), nextval('seq');
|
||||
----
|
||||
3 4
|
||||
|
||||
# NULL in nextval/currval
|
||||
query I
|
||||
SELECT nextval(NULL)
|
||||
----
|
||||
NULL
|
||||
|
||||
query I
|
||||
SELECT currval(NULL)
|
||||
----
|
||||
NULL
|
||||
|
||||
statement error
|
||||
SELECT nextval(a) FROM (VALUES ('seq'), (NULL), ('seq')) tbl1(a)
|
||||
----
|
||||
<REGEX>:.*Not implemented Error.*non-constant sequences are no longer supported.*
|
||||
|
||||
statement error
|
||||
SELECT currval(a) FROM (VALUES ('seq'), (NULL), ('seq')) tbl1(a)
|
||||
----
|
||||
<REGEX>:.*Not implemented Error.*non-constant sequences are no longer supported.*
|
||||
|
||||
# can't create a sequence that already exists
|
||||
statement error
|
||||
CREATE SEQUENCE seq;
|
||||
----
|
||||
<REGEX>:.*Catalog Error.*already exists.*
|
||||
|
||||
# drop the sequence
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# can't drop non-existing sequence
|
||||
statement error
|
||||
DROP SEQUENCE seq;
|
||||
----
|
||||
<REGEX>:.*Catalog Error: Sequence.*does not exist.*
|
||||
|
||||
# but doesn't fail with IF EXISTS
|
||||
statement ok
|
||||
DROP SEQUENCE IF EXISTS seq;
|
||||
|
||||
# INCREMENT BY
|
||||
statement ok
|
||||
CREATE SEQUENCE seq INCREMENT BY 2;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('"seq"')
|
||||
----
|
||||
3
|
||||
|
||||
query I
|
||||
SELECT currval('"seq"')
|
||||
----
|
||||
3
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# MINVALUE
|
||||
statement ok
|
||||
CREATE SEQUENCE seq MINVALUE 3;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
3
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
4
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# MAXVALUE
|
||||
statement ok
|
||||
CREATE SEQUENCE seq MAXVALUE 2;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
# max value exceeded
|
||||
statement error
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached maximum value of sequence.*
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# MAXVALUE and CYCLE
|
||||
statement ok
|
||||
CREATE SEQUENCE seq MAXVALUE 2 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
# max value exceeded: cycle back
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# START WITH, MINVALUE, MAXVALUE and CYCLE
|
||||
statement ok
|
||||
CREATE SEQUENCE seq MINVALUE 3 MAXVALUE 5 START WITH 4 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
4
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
4
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
5
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
5
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
3
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
3
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# START WITH defaults to MAXVALUE if increment is negative
|
||||
statement ok
|
||||
CREATE SEQUENCE seq INCREMENT BY -1 MINVALUE 0 MAXVALUE 2;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
0
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
0
|
||||
|
||||
statement error
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached minimum value of sequence.*
|
||||
|
||||
query I
|
||||
SELECT currval('seq')
|
||||
----
|
||||
0
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# START WITH defaults to MINVALUE if increment is positive
|
||||
statement ok
|
||||
CREATE SEQUENCE seq INCREMENT BY 1 MINVALUE 0 MAXVALUE 2;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
0
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
statement error
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*reached maximum value of sequence.*
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# for positive increment min_value/start defaults to 1 and max_value defaults to 2^63
|
||||
statement ok
|
||||
CREATE SEQUENCE seq INCREMENT 1 MAXVALUE 3 START 2 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
2
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
3
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# for negative increment min_value defaults to -2^63 and max_value/start defaults to -1
|
||||
statement ok
|
||||
CREATE SEQUENCE seq INCREMENT -1 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
-1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
-2
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
-3
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE seq INCREMENT -1 MINVALUE -2 CYCLE;
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
-1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
-2
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
-1
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# min_value defaults to 1, setting start to -1 gives start < min_value
|
||||
statement error
|
||||
CREATE SEQUENCE seq INCREMENT 1 START -1 CYCLE;
|
||||
----
|
||||
<REGEX>:.*Parser Error.*cannot be less than MINVALUE.*
|
||||
|
||||
# max_value defaults to -1, setting start to 1 gives start > max_value
|
||||
statement error
|
||||
CREATE SEQUENCE seq INCREMENT -1 START 1 CYCLE;
|
||||
----
|
||||
<REGEX>:.*Parser Error.*cannot be greater than MAXVALUE.*
|
||||
|
||||
# sequences in schemas
|
||||
statement ok
|
||||
CREATE SCHEMA a;
|
||||
|
||||
statement ok
|
||||
CREATE SCHEMA b;
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE a.seq;
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE b.seq;
|
||||
|
||||
query II
|
||||
SELECT nextval('a.seq'), nextval('b.seq');
|
||||
----
|
||||
1 1
|
||||
|
||||
query II
|
||||
SELECT currval('a.seq'), currval('b.seq');
|
||||
----
|
||||
1 1
|
||||
|
||||
# with quotes
|
||||
query II
|
||||
SELECT nextval('"a"."seq"'), nextval('"b".seq');
|
||||
----
|
||||
2 2
|
||||
|
||||
query II
|
||||
SELECT currval('"a"."seq"'), currval('"b".seq');
|
||||
----
|
||||
2 2
|
||||
|
||||
# unterminated quotes
|
||||
statement error
|
||||
SELECT nextval('"a"."seq');
|
||||
----
|
||||
<REGEX>:.*Parser Error.*Unterminated quote.*
|
||||
|
||||
# too many separators
|
||||
statement error
|
||||
SELECT nextval('a.b.c.d');
|
||||
----
|
||||
<REGEX>:.*Parser Error.*too many entries found.*
|
||||
|
||||
# start exceeds max value
|
||||
statement error
|
||||
CREATE SEQUENCE seq MAXVALUE 5 START WITH 6;
|
||||
----
|
||||
<REGEX>:.*Parser Error.*cannot be greater than MAXVALUE.*
|
||||
|
||||
# start preceeds min value
|
||||
statement error
|
||||
CREATE SEQUENCE seq MINVALUE 5 START WITH 4;
|
||||
----
|
||||
<REGEX>:.*Parser Error.*cannot be less than MINVALUE.*
|
||||
|
||||
# min value bigger than max
|
||||
statement error
|
||||
CREATE SEQUENCE seq MINVALUE 7 MAXVALUE 5;
|
||||
----
|
||||
<REGEX>:.*Parser Error.*must be less than MAXVALUE.*
|
||||
|
||||
# increment must not be 0
|
||||
statement error
|
||||
CREATE SEQUENCE seq INCREMENT 0;
|
||||
----
|
||||
<REGEX>:.*Parser Error.*Increment must not be zero.*
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE seq;
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE seq2;
|
||||
|
||||
# we can use operations in nextval
|
||||
query I
|
||||
SELECT nextval('s'||'e'||'q')
|
||||
----
|
||||
1
|
||||
|
||||
statement ok
|
||||
DROP SEQUENCE seq;
|
||||
|
||||
# sequences with tables
|
||||
statement ok
|
||||
CREATE SEQUENCE seq;
|
||||
|
||||
statement ok
|
||||
CREATE TABLE strings(s VARCHAR);
|
||||
|
||||
statement ok
|
||||
INSERT INTO strings VALUES ('seq'), ('seq2')
|
||||
|
||||
# nextval is run once per value
|
||||
query TI
|
||||
SELECT s, nextval('seq') FROM strings
|
||||
----
|
||||
seq 1
|
||||
seq2 2
|
||||
|
||||
query TI
|
||||
SELECT s, currval('seq') FROM strings
|
||||
----
|
||||
seq 2
|
||||
seq2 2
|
||||
|
||||
# we cannot use the strings from the table as input to the sequence
|
||||
statement error
|
||||
SELECT s, nextval(s) FROM strings
|
||||
----
|
||||
<REGEX>:.*Not implemented Error.*non-constant sequences are no longer supported.*
|
||||
|
||||
statement error
|
||||
SELECT s, currval(s) FROM strings
|
||||
----
|
||||
<REGEX>:.*Not implemented Error.*non-constant sequences are no longer supported.*
|
||||
|
||||
# this will also cause an error if the sequence does not exist
|
||||
statement ok
|
||||
INSERT INTO strings VALUES ('nonexistant_seq')
|
||||
|
||||
statement error
|
||||
SELECT s, nextval(s) FROM strings
|
||||
----
|
||||
<REGEX>:.*Not implemented Error.*non-constant sequences are no longer supported.*
|
||||
|
||||
# currval causes error for new sequence
|
||||
statement ok
|
||||
CREATE SEQUENCE fresh;
|
||||
|
||||
statement error
|
||||
select currval('fresh');
|
||||
----
|
||||
<REGEX>:.*Sequence Error.*sequence is not yet defined in this session.*
|
||||
|
||||
# convert inputs into varchar if that's not the case
|
||||
statement error
|
||||
select nextval(1 + 1);
|
||||
----
|
||||
<REGEX>:.*Binder Error: No function matches.*
|
||||
|
||||
statement error
|
||||
select currval(true);
|
||||
----
|
||||
<REGEX>:.*Binder Error: No function matches.*
|
||||
|
||||
# max value specified more than once
|
||||
statement error
|
||||
CREATE SEQUENCE wrongseq NO MAXVALUE MAXVALUE 2;
|
||||
----
|
||||
<REGEX>:.*Parser Error: Maxvalue should be passed as most once.*
|
||||
|
||||
# min value specified more than once
|
||||
statement error
|
||||
CREATE SEQUENCE wrongseq MINVALUE 10 MINVALUE 2;
|
||||
----
|
||||
<REGEX>:.*Parser Error: Minvalue should be passed as most once.*
|
||||
|
||||
# start value specified more than once
|
||||
statement error
|
||||
CREATE SEQUENCE wrongseq START 13 START WITH 3;
|
||||
----
|
||||
<REGEX>:.*Parser Error: Start value should be passed as most once.*
|
||||
|
||||
# cycle value specified more than once
|
||||
statement error
|
||||
CREATE SEQUENCE wrongseq CYCLE MAXVALUE 2 MINVALUE 1 NO CYCLE;
|
||||
----
|
||||
<REGEX>:.*Parser Error: Cycle value should be passed as most once.*
|
||||
|
||||
# increment value specified more than once
|
||||
statement error
|
||||
CREATE SEQUENCE wrongseq INCREMENT 2 INCREMENT BY -1;
|
||||
----
|
||||
<REGEX>:.*Parser Error: Increment value should be passed as most once.*
|
||||
29
external/duckdb/test/sql/catalog/sequence/test_sequence_dependency.test
vendored
Normal file
29
external/duckdb/test/sql/catalog/sequence/test_sequence_dependency.test
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# name: test/sql/catalog/sequence/test_sequence_dependency.test
|
||||
# description: Test Sequence Dependencies
|
||||
# group: [sequence]
|
||||
|
||||
require skip_reload
|
||||
|
||||
|
||||
statement ok
|
||||
create sequence seq;
|
||||
|
||||
statement ok
|
||||
create table integers(i integer default nextval('seq'));
|
||||
|
||||
# can't drop the sequence
|
||||
statement error
|
||||
drop sequence seq;
|
||||
----
|
||||
|
||||
statement ok
|
||||
begin transaction;
|
||||
|
||||
statement ok
|
||||
drop table integers;
|
||||
|
||||
statement ok
|
||||
drop sequence seq;
|
||||
|
||||
statement ok
|
||||
commit
|
||||
16
external/duckdb/test/sql/catalog/sequence/test_sequence_google_fuzz.test
vendored
Normal file
16
external/duckdb/test/sql/catalog/sequence/test_sequence_google_fuzz.test
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
# name: test/sql/catalog/sequence/test_sequence_google_fuzz.test
|
||||
# description: Test Sequence on results produce by the google fuzzer
|
||||
# group: [sequence]
|
||||
|
||||
statement error
|
||||
;creAte
|
||||
sequence
|
||||
uGeõó±õõõõ.õõõ.õ;creAte
|
||||
sequence
|
||||
uGeõõõõõ..õ;creAte
|
||||
sequence
|
||||
uGeõõõõõ..õ;creAte
|
||||
sequence
|
||||
uGeõõõõ
|
||||
----
|
||||
Catalog with name uGeõó±õõõõ does not exist!
|
||||
Reference in New Issue
Block a user