should be it
This commit is contained in:
42
external/duckdb/test/sql/upsert/upsert_default_expressions.test
vendored
Normal file
42
external/duckdb/test/sql/upsert/upsert_default_expressions.test
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
# name: test/sql/upsert/upsert_default_expressions.test
|
||||
# group: [upsert]
|
||||
|
||||
statement ok
|
||||
pragma enable_verification;
|
||||
|
||||
statement ok
|
||||
create or replace table tbl (
|
||||
a integer primary key default 4,
|
||||
b integer DEFAULT 3
|
||||
);
|
||||
|
||||
statement ok
|
||||
insert into tbl VALUES (2,3), (4,5)
|
||||
|
||||
query II
|
||||
select * from tbl;
|
||||
----
|
||||
2 3
|
||||
4 5
|
||||
|
||||
# DEFAULT in set expression
|
||||
statement ok
|
||||
insert into tbl VALUES (DEFAULT, 6) ON CONFLICT (a) DO UPDATE SET b = DEFAULT
|
||||
|
||||
query II
|
||||
select * from tbl;
|
||||
----
|
||||
2 3
|
||||
4 3
|
||||
|
||||
# DEFAULT in ON CONFLICT (..) WHERE <expr>
|
||||
statement error
|
||||
insert into tbl VALUES (4,8) ON CONFLICT (a) DO UPDATE SET b = excluded.b WHERE a = DEFAULT;
|
||||
----
|
||||
WHERE clause cannot contain DEFAULT clause
|
||||
|
||||
# DEFAULT in DO UPDATE SET .. WHERE <expr>
|
||||
statement error
|
||||
insert into tbl VALUES (4,3) ON CONFLICT (a) DO UPDATE SET b = excluded.b WHERE excluded.b = DEFAULT * 2;
|
||||
----
|
||||
WHERE clause cannot contain DEFAULT clause
|
||||
Reference in New Issue
Block a user