]> granicus.if.org Git - postgresql/commitdiff
Silence compiler warning in Assert()
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 8 Oct 2018 13:37:21 +0000 (10:37 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 8 Oct 2018 13:37:21 +0000 (10:37 -0300)
gcc 6.3 does not whine about this mistake I made in 39808e8868c8 but
evidently lots of other compilers do, according to Michael Paquier,
Peter Eisentraut, Arthur Zakirov, Tomas Vondra.

Discussion: too many to list

src/backend/commands/event_trigger.c

index 2c1dc47541c5c6e056f3c563f37a937c44c53b9a..9a702e4097ee28b58d5727febc01d70047ced6af 100644 (file)
@@ -1761,7 +1761,7 @@ EventTriggerCollectAlterTableSubcmd(Node *subcmd, ObjectAddress address)
                return;
 
        Assert(IsA(subcmd, AlterTableCmd));
-       Assert(OidIsValid(currentEventTriggerState->currentCommand));
+       Assert(currentEventTriggerState->currentCommand != NULL);
        Assert(OidIsValid(currentEventTriggerState->currentCommand->d.alterTable.objectId));
 
        oldcxt = MemoryContextSwitchTo(currentEventTriggerState->cxt);