Fix variable initialization with ALTER SUBSCRIPTION DROP PUBLICATION
authorMichael Paquier <michael@paquier.xyz>
Mon, 28 Jun 2021 03:11:18 +0000 (12:11 +0900)
committerMichael Paquier <michael@paquier.xyz>
Mon, 28 Jun 2021 03:11:18 +0000 (12:11 +0900)
copy_data is not a supported option with this sub-command of ALTER
SUBSCRIPTION, which would not make a variable related to it initialized
after parsing the option set in DefElems.  A refresh could then refer to
it.

Author: Ranier Vilela
Reviewed-by: Peter Smith
Discussion: https://postgr.es/m/CAEudQAp5P8nr=ze2Gv=BMj=DJFZnrvendZCZcC-fos3QiDe2sg@mail.gmail.com

src/backend/commands/subscriptioncmds.c

index e9a97db9a55797b2e2f20556ac6e3ad3bbf28a6e..b862e59f1da8a42aa73d5a16ef27dd403b1dba97 100644 (file)
@@ -949,7 +949,7 @@ AlterSubscription(AlterSubscriptionStmt *stmt, bool isTopLevel)
        case ALTER_SUBSCRIPTION_DROP_PUBLICATION:
            {
                bool        isadd = stmt->kind == ALTER_SUBSCRIPTION_ADD_PUBLICATION;
-               bool        copy_data;
+               bool        copy_data = false;
                bool        refresh;
                List       *publist;