1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-15 19:21:59 +03:00

Make more use of castNode()

This commit is contained in:
Peter Eisentraut
2017-02-21 11:33:07 -05:00
parent 4e5ce3c1ae
commit 38d103763d
37 changed files with 121 additions and 222 deletions

View File

@ -433,9 +433,8 @@ get_first_col_type(Plan *plan, Oid *coltype, int32 *coltypmod,
/* In cases such as EXISTS, tlist might be empty; arbitrarily use VOID */
if (plan->targetlist)
{
TargetEntry *tent = (TargetEntry *) linitial(plan->targetlist);
TargetEntry *tent = castNode(TargetEntry, linitial(plan->targetlist));
Assert(IsA(tent, TargetEntry));
if (!tent->resjunk)
{
*coltype = exprType((Node *) tent->expr);
@ -601,14 +600,14 @@ make_subplan(PlannerInfo *root, Query *orig_subquery,
AlternativeSubPlan *asplan;
/* OK, convert to SubPlan format. */
hashplan = (SubPlan *) build_subplan(root, plan, subroot,
plan_params,
ANY_SUBLINK, 0,
newtestexpr,
false, true,
best_path->parallel_safe);
hashplan = castNode(SubPlan,
build_subplan(root, plan, subroot,
plan_params,
ANY_SUBLINK, 0,
newtestexpr,
false, true,
best_path->parallel_safe));
/* Check we got what we expected */
Assert(IsA(hashplan, SubPlan));
Assert(hashplan->parParam == NIL);
Assert(hashplan->useHashTable);
/* build_subplan won't have filled in paramIds */