should be it
This commit is contained in:
41
external/duckdb/test/sql/attach/attach_sequence.test
vendored
Normal file
41
external/duckdb/test/sql/attach/attach_sequence.test
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
# name: test/sql/attach/attach_sequence.test
|
||||
# description: Test attach mixed with sequences and default values
|
||||
# group: [attach]
|
||||
|
||||
statement ok
|
||||
ATTACH DATABASE '__TEST_DIR__/attach_seq.db' AS db1;
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE seq;
|
||||
|
||||
statement error
|
||||
CREATE TABLE db1.integers(i INTEGER DEFAULT nextval('seq'))
|
||||
----
|
||||
TransactionContext Error: Attempting to write to database "db1" in a transaction that has already modified database
|
||||
|
||||
statement ok
|
||||
CREATE SEQUENCE db1.seq
|
||||
|
||||
statement ok
|
||||
CREATE TABLE db1.integers(i INTEGER DEFAULT nextval('db1.seq'))
|
||||
|
||||
query I
|
||||
SELECT nextval('db1.seq')
|
||||
----
|
||||
1
|
||||
|
||||
query I
|
||||
SELECT nextval('seq')
|
||||
----
|
||||
1
|
||||
|
||||
statement error
|
||||
CREATE TABLE integers(i INTEGER DEFAULT nextval('db1.seq'))
|
||||
----
|
||||
<REGEX>:TransactionContext Error:.*in a transaction that has already modified database "db1".*
|
||||
|
||||
statement ok
|
||||
detach db1;
|
||||
|
||||
statement ok
|
||||
ATTACH DATABASE '__TEST_DIR__/attach_seq.db' AS db1;
|
||||
Reference in New Issue
Block a user