From 5b7ba75f7ff854003231e8099e3038c7e2eba875 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 6 Nov 2019 08:07:04 +0100 Subject: [PATCH] Remove unused function argument The cache_plan argument to ri_PlanCheck has not been used since e8c9fd5fdf768323911f7088e8287f63b513c3c6. Reviewed-by: vignesh C Discussion: https://www.postgresql.org/message-id/flat/ec8a8b45-a30b-9193-cd4b-985d60d1497e%402ndquadrant.com --- src/backend/utils/adt/ri_triggers.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c index fb477d4fa0..caf27f8bcb 100644 --- a/src/backend/utils/adt/ri_triggers.c +++ b/src/backend/utils/adt/ri_triggers.c @@ -209,8 +209,7 @@ static const RI_ConstraintInfo *ri_FetchConstraintInfo(Trigger *trigger, Relation trig_rel, bool rel_is_pk); static const RI_ConstraintInfo *ri_LoadConstraintInfo(Oid constraintOid); static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes, - RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel, - bool cache_plan); + RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel); static bool ri_PerformCheck(const RI_ConstraintInfo *riinfo, RI_QueryKey *qkey, SPIPlanPtr qplan, Relation fk_rel, Relation pk_rel, @@ -385,7 +384,7 @@ RI_FKey_check(TriggerData *trigdata) /* Prepare and save the plan */ qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, - &qkey, fk_rel, pk_rel, true); + &qkey, fk_rel, pk_rel); } /* @@ -512,7 +511,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel, /* Prepare and save the plan */ qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, - &qkey, fk_rel, pk_rel, true); + &qkey, fk_rel, pk_rel); } /* @@ -704,7 +703,7 @@ ri_restrict(TriggerData *trigdata, bool is_no_action) /* Prepare and save the plan */ qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, - &qkey, fk_rel, pk_rel, true); + &qkey, fk_rel, pk_rel); } /* @@ -809,7 +808,7 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS) /* Prepare and save the plan */ qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, - &qkey, fk_rel, pk_rel, true); + &qkey, fk_rel, pk_rel); } /* @@ -931,7 +930,7 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS) /* Prepare and save the plan */ qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys * 2, queryoids, - &qkey, fk_rel, pk_rel, true); + &qkey, fk_rel, pk_rel); } /* @@ -1110,7 +1109,7 @@ ri_set(TriggerData *trigdata, bool is_set_null) /* Prepare and save the plan */ qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, - &qkey, fk_rel, pk_rel, true); + &qkey, fk_rel, pk_rel); } /* @@ -2128,8 +2127,7 @@ InvalidateConstraintCacheCallBack(Datum arg, int cacheid, uint32 hashvalue) */ static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes, - RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel, - bool cache_plan) + RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel) { SPIPlanPtr qplan; Relation query_rel; @@ -2160,12 +2158,9 @@ ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes, /* Restore UID and security context */ SetUserIdAndSecContext(save_userid, save_sec_context); - /* Save the plan if requested */ - if (cache_plan) - { - SPI_keepplan(qplan); - ri_HashPreparedPlan(qkey, qplan); - } + /* Save the plan */ + SPI_keepplan(qplan); + ri_HashPreparedPlan(qkey, qplan); return qplan; }