summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/subscription.out
diff options
context:
space:
mode:
authorPeter Eisentraut2017-05-18 00:47:37 +0000
committerPeter Eisentraut2017-05-18 00:47:37 +0000
commit62345698513cbcb3c48a6dae414abf0f24fd163a (patch)
treedce30a85bf9960d030111553ee651ada8b508240 /src/test/regress/expected/subscription.out
parentce554810329b9b8e862eade08b598148931eb456 (diff)
Improve CREATE SUBSCRIPTION option parsing
When creating a subscription with slot_name = NONE, we failed to check that also create_slot = false and enabled = false were set. This created an invalid subscription and could later lead to a crash if a NULL slot name was accessed. Add more checks around that for robustness. Reported-by: tushar <[email protected]>
Diffstat (limited to 'src/test/regress/expected/subscription.out')
-rw-r--r--src/test/regress/expected/subscription.out8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/regress/expected/subscription.out b/src/test/regress/expected/subscription.out
index 1c42013b472..91ba8ab95a6 100644
--- a/src/test/regress/expected/subscription.out
+++ b/src/test/regress/expected/subscription.out
@@ -56,6 +56,12 @@ CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpu
ERROR: slot_name = NONE and enabled = true are mutually exclusive options
CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, create_slot = true);
ERROR: slot_name = NONE and create_slot = true are mutually exclusive options
+CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE);
+ERROR: subscription with slot_name = NONE must also set enabled = false
+CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, enabled = false);
+ERROR: subscription with slot_name = NONE must also set create_slot = false
+CREATE SUBSCRIPTION testsub2 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, create_slot = false);
+ERROR: subscription with slot_name = NONE must also set enabled = false
-- ok - with slot_name = NONE
CREATE SUBSCRIPTION testsub3 CONNECTION 'dbname=doesnotexist' PUBLICATION testpub WITH (slot_name = NONE, connect = false);
WARNING: tables were not subscribed, you will have to run ALTER SUBSCRIPTION ... REFRESH PUBLICATION to subscribe the tables
@@ -82,6 +88,8 @@ ALTER SUBSCRIPTION testsub SET (slot_name = 'newname');
-- fail
ALTER SUBSCRIPTION doesnotexist CONNECTION 'dbname=doesnotexist2';
ERROR: subscription "doesnotexist" does not exist
+ALTER SUBSCRIPTION testsub SET (create_slot = false);
+ERROR: unrecognized subscription parameter: create_slot
\dRs+
List of subscriptions
Name | Owner | Enabled | Publication | Synchronous commit | Conninfo