Remove unused function argument
The cache_plan argument to ri_PlanCheck has not been used since e8c9fd5fdf768323911f7088e8287f63b513c3c6. Reviewed-by: vignesh C <vignesh21@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/ec8a8b45-a30b-9193-cd4b-985d60d1497e%402ndquadrant.com
This commit is contained in:
parent
5f6b1eb0cf
commit
5b7ba75f7f
@ -209,8 +209,7 @@ static const RI_ConstraintInfo *ri_FetchConstraintInfo(Trigger *trigger,
|
|||||||
Relation trig_rel, bool rel_is_pk);
|
Relation trig_rel, bool rel_is_pk);
|
||||||
static const RI_ConstraintInfo *ri_LoadConstraintInfo(Oid constraintOid);
|
static const RI_ConstraintInfo *ri_LoadConstraintInfo(Oid constraintOid);
|
||||||
static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
|
static SPIPlanPtr ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
|
||||||
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel,
|
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel);
|
||||||
bool cache_plan);
|
|
||||||
static bool ri_PerformCheck(const RI_ConstraintInfo *riinfo,
|
static bool ri_PerformCheck(const RI_ConstraintInfo *riinfo,
|
||||||
RI_QueryKey *qkey, SPIPlanPtr qplan,
|
RI_QueryKey *qkey, SPIPlanPtr qplan,
|
||||||
Relation fk_rel, Relation pk_rel,
|
Relation fk_rel, Relation pk_rel,
|
||||||
@ -385,7 +384,7 @@ RI_FKey_check(TriggerData *trigdata)
|
|||||||
|
|
||||||
/* Prepare and save the plan */
|
/* Prepare and save the plan */
|
||||||
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
|
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 */
|
/* Prepare and save the plan */
|
||||||
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
|
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 */
|
/* Prepare and save the plan */
|
||||||
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
|
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 */
|
/* Prepare and save the plan */
|
||||||
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
|
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 */
|
/* Prepare and save the plan */
|
||||||
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys * 2, queryoids,
|
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 */
|
/* Prepare and save the plan */
|
||||||
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
|
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
|
static SPIPlanPtr
|
||||||
ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
|
ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
|
||||||
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel,
|
RI_QueryKey *qkey, Relation fk_rel, Relation pk_rel)
|
||||||
bool cache_plan)
|
|
||||||
{
|
{
|
||||||
SPIPlanPtr qplan;
|
SPIPlanPtr qplan;
|
||||||
Relation query_rel;
|
Relation query_rel;
|
||||||
@ -2160,12 +2158,9 @@ ri_PlanCheck(const char *querystr, int nargs, Oid *argtypes,
|
|||||||
/* Restore UID and security context */
|
/* Restore UID and security context */
|
||||||
SetUserIdAndSecContext(save_userid, save_sec_context);
|
SetUserIdAndSecContext(save_userid, save_sec_context);
|
||||||
|
|
||||||
/* Save the plan if requested */
|
/* Save the plan */
|
||||||
if (cache_plan)
|
SPI_keepplan(qplan);
|
||||||
{
|
ri_HashPreparedPlan(qkey, qplan);
|
||||||
SPI_keepplan(qplan);
|
|
||||||
ri_HashPreparedPlan(qkey, qplan);
|
|
||||||
}
|
|
||||||
|
|
||||||
return qplan;
|
return qplan;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user