aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/pquery.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-01-26 22:09:34 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-01-26 22:09:34 -0500
commit7afd56c3c6d8360a5bfdfb2de30038b239fd756b (patch)
treedf9eb70bc951cdfe35629861285d5c6f31789ad7 /src/backend/tcop/pquery.c
parent9ba8a9ce4548bb34b7136b7463a61b2c499979a3 (diff)
downloadpostgresql-7afd56c3c6d8360a5bfdfb2de30038b239fd756b.tar.gz
postgresql-7afd56c3c6d8360a5bfdfb2de30038b239fd756b.zip
Use castNode() in a bunch of statement-list-related code.
When I wrote commit ab1f0c822, I really missed the castNode() macro that Peter E. had proposed shortly before. This back-fills the uses I would have put it to. It's probably not all that significant, but there are more assertions here than there were before, and conceivably they will help catch any bugs associated with those representation changes. I left behind a number of usages like "(Query *) copyObject(query_var)". Those could have been converted as well, but Peter has proposed another notational improvement that would handle copyObject cases automatically, so I let that be for now.
Diffstat (limited to 'src/backend/tcop/pquery.c')
-rw-r--r--src/backend/tcop/pquery.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/tcop/pquery.c b/src/backend/tcop/pquery.c
index 704be399cf7..e64ea2ed767 100644
--- a/src/backend/tcop/pquery.c
+++ b/src/backend/tcop/pquery.c
@@ -487,7 +487,7 @@ PortalStart(Portal portal, ParamListInfo params,
* Create QueryDesc in portal's context; for the moment, set
* the destination to DestNone.
*/
- queryDesc = CreateQueryDesc((PlannedStmt *) linitial(portal->stmts),
+ queryDesc = CreateQueryDesc(castNode(PlannedStmt, linitial(portal->stmts)),
portal->sourceText,
GetActiveSnapshot(),
InvalidSnapshot,
@@ -1020,7 +1020,7 @@ FillPortalStore(Portal portal, bool isTopLevel)
break;
case PORTAL_UTIL_SELECT:
- PortalRunUtility(portal, (PlannedStmt *) linitial(portal->stmts),
+ PortalRunUtility(portal, castNode(PlannedStmt, linitial(portal->stmts)),
isTopLevel, true, treceiver, completionTag);
break;
@@ -1215,7 +1215,7 @@ PortalRunMulti(Portal portal,
*/
foreach(stmtlist_item, portal->stmts)
{
- PlannedStmt *pstmt = (PlannedStmt *) lfirst(stmtlist_item);
+ PlannedStmt *pstmt = castNode(PlannedStmt, lfirst(stmtlist_item));
/*
* If we got a cancel signal in prior command, quit