static bool ri_fastpath_is_applicable(const RI_ConstraintInfo *riinfo);
static void ri_CheckPermissions(Relation query_rel);
static bool recheck_matched_pk_tuple(Relation idxrel, ScanKeyData *skeys,
- TupleTableSlot *new_slot);
+ int nkeys, TupleTableSlot *new_slot);
static void build_index_scankeys(const RI_ConstraintInfo *riinfo,
Relation idx_rel, Datum *pk_vals,
char *pk_nulls, ScanKey skeys);
idx_rel->rd_indcollation[0],
fpmeta->regops[0],
found_val);
- if (!recheck_matched_pk_tuple(idx_rel, recheck_skey, pk_slot))
+ if (!recheck_matched_pk_tuple(idx_rel, recheck_skey, 1, pk_slot))
continue;
}
&concurrently_updated))
{
if (concurrently_updated)
- found = recheck_matched_pk_tuple(idx_rel, skey, slot);
+ found = recheck_matched_pk_tuple(idx_rel, skey, nkeys, slot);
else
found = true;
}
* not found.
*/
static bool
-recheck_matched_pk_tuple(Relation idxrel, ScanKeyData *skeys,
+recheck_matched_pk_tuple(Relation idxrel, ScanKeyData *skeys, int nkeys,
TupleTableSlot *new_slot)
{
/*
indexInfo->ii_ExclusionOps == NULL);
/* Form the index values and isnull flags given the table tuple. */
+ Assert(nkeys == indexInfo->ii_NumIndexKeyAttrs);
FormIndexDatum(indexInfo, new_slot, NULL, values, isnull);
- for (int i = 0; i < indexInfo->ii_NumIndexKeyAttrs; i++)
+ for (int i = 0; i < nkeys; i++)
{
ScanKeyData *skey = &skeys[i];