]> granicus.if.org Git - postgresql/commitdiff
Slightly correct context check for event triggers
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 5 Oct 2018 13:20:32 +0000 (15:20 +0200)
committerPeter Eisentraut <peter_e@gmx.net>
Wed, 10 Oct 2018 20:41:12 +0000 (22:41 +0200)
The previous check for a "complete query" omitted the new
PROCESS_UTILITY_QUERY_NONATOMIC value.  This didn't actually make a
difference in practice, because only CALL and SET from PL/pgSQL run in
this state, but it's more correct to include it anyway.

Discussion: https://www.postgresql.org/message-id/4566041d-2567-74d2-d135-19ff6a20fe51%402ndquadrant.com

src/backend/tcop/utility.c

index 898091c45f84939e6e2b51ddbf5382776d5ee77c..ede1621d3ea8d21cf88416c6e8e1ad6f96e405c3 100644 (file)
@@ -943,7 +943,7 @@ ProcessUtilitySlow(ParseState *pstate,
 {
        Node       *parsetree = pstmt->utilityStmt;
        bool            isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL);
-       bool            isCompleteQuery = (context <= PROCESS_UTILITY_QUERY);
+       bool            isCompleteQuery = (context != PROCESS_UTILITY_SUBCOMMAND);
        bool            needCleanup;
        bool            commandCollected = false;
        ObjectAddress address;