aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/functions.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/executor/functions.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/executor/functions.c')
-rw-r--r--src/backend/executor/functions.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/executor/functions.c b/src/backend/executor/functions.c
index 15c709139ad..2d49a656502 100644
--- a/src/backend/executor/functions.c
+++ b/src/backend/executor/functions.c
@@ -707,7 +707,7 @@ init_sql_fcache(FmgrInfo *finfo, Oid collation, bool lazyEvalOK)
flat_query_list = NIL;
foreach(lc, raw_parsetree_list)
{
- RawStmt *parsetree = (RawStmt *) lfirst(lc);
+ RawStmt *parsetree = castNode(RawStmt, lfirst(lc));
List *queryTree_sublist;
queryTree_sublist = pg_analyze_and_rewrite_params(parsetree,
@@ -1551,7 +1551,7 @@ check_sql_fn_retval(Oid func_id, Oid rettype, List *queryTreeList,
parse = NULL;
foreach(lc, queryTreeList)
{
- Query *q = (Query *) lfirst(lc);
+ Query *q = castNode(Query, lfirst(lc));
if (q->canSetTag)
parse = q;