Skip to content

Commit 5b7ba75

Browse files
committed
Remove unused function argument
The cache_plan argument to ri_PlanCheck has not been used since e8c9fd5. Reviewed-by: vignesh C <vignesh21@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/ec8a8b45-a30b-9193-cd4b-985d60d1497e%402ndquadrant.com
1 parent 5f6b1eb commit 5b7ba75

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

src/backend/utils/adt/ri_triggers.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,7 @@ static const RI_ConstraintInfo *ri_FetchConstraintInfo(Trigger *trigger,
209209
Relation trig_rel, bool rel_is_pk);
210210
static const RI_ConstraintInfo *ri_LoadConstraintInfo(Oid constraintOid);
211211
static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
212-
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel,
213-
bool cache_plan);
212+
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel);
214213
static bool ri_PerformCheck(const RI_ConstraintInfo *riinfo,
215214
RI_QueryKey *qkey, SPIPlanPtr qplan,
216215
Relation fk_rel, Relation pk_rel,
@@ -385,7 +384,7 @@ RI_FKey_check(TriggerData *trigdata)
385384

386385
/* Prepare and save the plan */
387386
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
388-
&qkey, fk_rel, pk_rel, true);
387+
&qkey, fk_rel, pk_rel);
389388
}
390389

391390
/*
@@ -512,7 +511,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel,
512511

513512
/* Prepare and save the plan */
514513
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
515-
&qkey, fk_rel, pk_rel, true);
514+
&qkey, fk_rel, pk_rel);
516515
}
517516

518517
/*
@@ -704,7 +703,7 @@ ri_restrict(TriggerData *trigdata, bool is_no_action)
704703

705704
/* Prepare and save the plan */
706705
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
707-
&qkey, fk_rel, pk_rel, true);
706+
&qkey, fk_rel, pk_rel);
708707
}
709708

710709
/*
@@ -809,7 +808,7 @@ RI_FKey_cascade_del(PG_FUNCTION_ARGS)
809808

810809
/* Prepare and save the plan */
811810
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
812-
&qkey, fk_rel, pk_rel, true);
811+
&qkey, fk_rel, pk_rel);
813812
}
814813

815814
/*
@@ -931,7 +930,7 @@ RI_FKey_cascade_upd(PG_FUNCTION_ARGS)
931930

932931
/* Prepare and save the plan */
933932
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys * 2, queryoids,
934-
&qkey, fk_rel, pk_rel, true);
933+
&qkey, fk_rel, pk_rel);
935934
}
936935

937936
/*
@@ -1110,7 +1109,7 @@ ri_set(TriggerData *trigdata, bool is_set_null)
11101109

11111110
/* Prepare and save the plan */
11121111
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
1113-
&qkey, fk_rel, pk_rel, true);
1112+
&qkey, fk_rel, pk_rel);
11141113
}
11151114

11161115
/*
@@ -2128,8 +2127,7 @@ InvalidateConstraintCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
21282127
*/
21292128
static SPIPlanPtr
21302129
ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
2131-
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel,
2132-
bool cache_plan)
2130+
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel)
21332131
{
21342132
SPIPlanPtr qplan;
21352133
Relation query_rel;
@@ -2160,12 +2158,9 @@ ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
21602158
/* Restore UID and security context */
21612159
SetUserIdAndSecContext(save_userid, save_sec_context);
21622160

2163-
/* Save the plan if requested */
2164-
if (cache_plan)
2165-
{
2166-
SPI_keepplan(qplan);
2167-
ri_HashPreparedPlan(qkey, qplan);
2168-
}
2161+
/* Save the plan */
2162+
SPI_keepplan(qplan);
2163+
ri_HashPreparedPlan(qkey, qplan);
21692164

21702165
return qplan;
21712166
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy