Skip to content

Commit 52f3a9d

Browse files
committed
Small refactoring
Put the "atomic" argument of ExecuteDoStmt() and ExecuteCallStmt() into a variable instead of repeating the formula.
1 parent 66ee851 commit 52f3a9d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/backend/tcop/utility.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
382382
{
383383
Node *parsetree = pstmt->utilityStmt;
384384
bool isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL);
385+
bool isAtomicContext = (context != PROCESS_UTILITY_TOPLEVEL || IsTransactionBlock());
385386
ParseState *pstate;
386387

387388
check_xact_readonly(parsetree);
@@ -514,8 +515,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
514515
break;
515516

516517
case T_DoStmt:
517-
ExecuteDoStmt((DoStmt *) parsetree,
518-
(context != PROCESS_UTILITY_TOPLEVEL || IsTransactionBlock()));
518+
ExecuteDoStmt((DoStmt *) parsetree, isAtomicContext);
519519
break;
520520

521521
case T_CreateTableSpaceStmt:
@@ -644,9 +644,7 @@ standard_ProcessUtility(PlannedStmt *pstmt,
644644
break;
645645

646646
case T_CallStmt:
647-
ExecuteCallStmt(castNode(CallStmt, parsetree), params,
648-
(context != PROCESS_UTILITY_TOPLEVEL || IsTransactionBlock()),
649-
dest);
647+
ExecuteCallStmt(castNode(CallStmt, parsetree), params, isAtomicContext, dest);
650648
break;
651649

652650
case T_ClusterStmt:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy