diff options
Diffstat (limited to 'src/backend/utils/cache/plancache.c')
-rw-r--r-- | src/backend/utils/cache/plancache.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/utils/cache/plancache.c b/src/backend/utils/cache/plancache.c index 50da116cf4..abff7474f5 100644 --- a/src/backend/utils/cache/plancache.c +++ b/src/backend/utils/cache/plancache.c @@ -979,7 +979,7 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist, is_transient = false; foreach(lc, plist) { - PlannedStmt *plannedstmt = castNode(PlannedStmt, lfirst(lc)); + PlannedStmt *plannedstmt = lfirst_node(PlannedStmt, lc); if (plannedstmt->commandType == CMD_UTILITY) continue; /* Ignore utility statements */ @@ -1074,7 +1074,7 @@ cached_plan_cost(CachedPlan *plan, bool include_planner) foreach(lc, plan->stmt_list) { - PlannedStmt *plannedstmt = castNode(PlannedStmt, lfirst(lc)); + PlannedStmt *plannedstmt = lfirst_node(PlannedStmt, lc); if (plannedstmt->commandType == CMD_UTILITY) continue; /* Ignore utility statements */ @@ -1462,7 +1462,7 @@ QueryListGetPrimaryStmt(List *stmts) foreach(lc, stmts) { - Query *stmt = castNode(Query, lfirst(lc)); + Query *stmt = lfirst_node(Query, lc); if (stmt->canSetTag) return stmt; @@ -1481,7 +1481,7 @@ AcquireExecutorLocks(List *stmt_list, bool acquire) foreach(lc1, stmt_list) { - PlannedStmt *plannedstmt = castNode(PlannedStmt, lfirst(lc1)); + PlannedStmt *plannedstmt = lfirst_node(PlannedStmt, lc1); int rt_index; ListCell *lc2; @@ -1551,7 +1551,7 @@ AcquirePlannerLocks(List *stmt_list, bool acquire) foreach(lc, stmt_list) { - Query *query = castNode(Query, lfirst(lc)); + Query *query = lfirst_node(Query, lc); if (query->commandType == CMD_UTILITY) { @@ -1618,7 +1618,7 @@ ScanQueryForLocks(Query *parsetree, bool acquire) /* Recurse into subquery-in-WITH */ foreach(lc, parsetree->cteList) { - CommonTableExpr *cte = castNode(CommonTableExpr, lfirst(lc)); + CommonTableExpr *cte = lfirst_node(CommonTableExpr, lc); ScanQueryForLocks(castNode(Query, cte->ctequery), acquire); } @@ -1676,7 +1676,7 @@ PlanCacheComputeResultDesc(List *stmt_list) { case PORTAL_ONE_SELECT: case PORTAL_ONE_MOD_WITH: - query = castNode(Query, linitial(stmt_list)); + query = linitial_node(Query, stmt_list); return ExecCleanTypeFromTL(query->targetList, false); case PORTAL_ONE_RETURNING: @@ -1685,7 +1685,7 @@ PlanCacheComputeResultDesc(List *stmt_list) return ExecCleanTypeFromTL(query->returningList, false); case PORTAL_UTIL_SELECT: - query = castNode(Query, linitial(stmt_list)); + query = linitial_node(Query, stmt_list); Assert(query->utilityStmt); return UtilityTupleDescriptor(query->utilityStmt); @@ -1742,7 +1742,7 @@ PlanCacheRelCallback(Datum arg, Oid relid) foreach(lc, plansource->gplan->stmt_list) { - PlannedStmt *plannedstmt = castNode(PlannedStmt, lfirst(lc)); + PlannedStmt *plannedstmt = lfirst_node(PlannedStmt, lc); if (plannedstmt->commandType == CMD_UTILITY) continue; /* Ignore utility statements */ @@ -1815,7 +1815,7 @@ PlanCacheFuncCallback(Datum arg, int cacheid, uint32 hashvalue) { foreach(lc, plansource->gplan->stmt_list) { - PlannedStmt *plannedstmt = castNode(PlannedStmt, lfirst(lc)); + PlannedStmt *plannedstmt = lfirst_node(PlannedStmt, lc); ListCell *lc3; if (plannedstmt->commandType == CMD_UTILITY) @@ -1888,7 +1888,7 @@ ResetPlanCache(void) */ foreach(lc, plansource->query_list) { - Query *query = castNode(Query, lfirst(lc)); + Query *query = lfirst_node(Query, lc); if (query->commandType != CMD_UTILITY || UtilityContainsQuery(query->utilityStmt)) |