diff --git a/src/test/regress/expected/discard.out b/src/test/regress/expected/discard.out new file mode 100644 index 0000000..85f1227 --- /dev/null +++ b/src/test/regress/expected/discard.out @@ -0,0 +1,17 @@ +-- +-- DISCARD +-- +DISCARD ALL; +DISCARD TEMP; +DISCARD TEMPORARY; +DISCARD PLANS; +-- Should fail. DISCARD ALL should not work within a transaction +BEGIN TRANSACTION; +DISCARD ALL; +ERROR: DISCARD ALL cannot run inside a transaction block +ROLLBACK; +-- Should fail. Invalid DISCARD option +DISCARD invalid_option; +ERROR: syntax error at or near "invalid_option" +LINE 1: DISCARD invalid_option; + ^ diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index 2af28b1..92e286e 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -83,7 +83,7 @@ test: select_into select_distinct select_distinct_on select_implicit select_havi # ---------- # Another group of parallel tests # ---------- -test: privileges security_label collate matview +test: privileges security_label collate matview discard # ---------- # Another group of parallel tests diff --git a/src/test/regress/sql/discard.sql b/src/test/regress/sql/discard.sql new file mode 100644 index 0000000..6d99631 --- /dev/null +++ b/src/test/regress/sql/discard.sql @@ -0,0 +1,19 @@ +-- +-- DISCARD +-- + +DISCARD ALL; + +DISCARD TEMP; + +DISCARD TEMPORARY; + +DISCARD PLANS; + +-- Should fail. DISCARD ALL should not work within a transaction +BEGIN TRANSACTION; +DISCARD ALL; +ROLLBACK; + +-- Should fail. Invalid DISCARD option +DISCARD invalid_option;