-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
…-23.2-112054 release-23.2: sql: fix statement tags for CREATE and DROP PROCEDURE
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# LogicTest: !local-mixed-23.1 | ||
|
||
subtest statement-control | ||
|
||
statement ok | ||
SET use_declarative_schema_changer = 'on' | ||
|
||
# Disable CREATE FUNCTION. | ||
statement ok | ||
SET CLUSTER SETTING sql.schema.force_declarative_statements='!CREATE FUNCTION' | ||
|
||
# Verify that it is disabled. | ||
statement error pgcode 0A000 cannot explain a statement which is not supported by the declarative schema changer | ||
EXPLAIN (DDL) CREATE FUNCTION f() RETURNS INT LANGUAGE SQL AS 'SELECT 1' | ||
|
||
# Falling-back to the legacy schema changer works. | ||
statement ok | ||
CREATE FUNCTION f() RETURNS INT LANGUAGE SQL AS 'SELECT 1' | ||
|
||
# Disable CREATE PROCEDURE. | ||
statement ok | ||
SET CLUSTER SETTING sql.schema.force_declarative_statements='!CREATE PROCEDURE' | ||
|
||
# Verify that it is disabled. | ||
statement error pgcode 0A000 cannot explain a statement which is not supported by the declarative schema changer | ||
EXPLAIN (DDL) CREATE PROCEDURE p() LANGUAGE SQL as 'SELECT 1' | ||
|
||
# Falling-back to the legacy schema changer works. | ||
statement ok | ||
CREATE PROCEDURE p() LANGUAGE SQL as 'SELECT 1' | ||
|
||
# Disable DROP FUNCTION. | ||
statement ok | ||
SET CLUSTER SETTING sql.schema.force_declarative_statements='!DROP FUNCTION' | ||
|
||
# Verify that it is disabled. | ||
statement error pgcode 0A000 cannot explain a statement which is not supported by the declarative schema changer | ||
EXPLAIN (DDL) DROP FUNCTION f | ||
|
||
# Falling-back to the legacy schema changer works. | ||
statement ok | ||
DROP FUNCTION f | ||
|
||
# Disable DROP PROCEDURE. | ||
statement ok | ||
SET CLUSTER SETTING sql.schema.force_declarative_statements='!DROP PROCEDURE' | ||
|
||
# Verify that it is disabled. | ||
statement error pgcode 0A000 cannot explain a statement which is not supported by the declarative schema changer | ||
EXPLAIN (DDL) DROP PROCEDURE p | ||
|
||
# Falling-back to the legacy schema changer works. | ||
statement ok | ||
DROP PROCEDURE p | ||
|
||
subtest end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.