(FmgrInfo *) palloc(nkeys * sizeof(FmgrInfo));
hashtable->inner_hashfunctions =
(FmgrInfo *) palloc(nkeys * sizeof(FmgrInfo));
+ hashtable->outer_hashfunctioncalls =
+ (FunctionCallInfoData *) palloc(nkeys * sizeof(FunctionCallInfoData));
+ hashtable->inner_hashfunctioncalls =
+ (FunctionCallInfoData *) palloc(nkeys * sizeof(FunctionCallInfoData));
hashtable->hashStrict = (bool *) palloc(nkeys * sizeof(bool));
i = 0;
foreach(ho, hashOperators)
elog(ERROR, "could not find hash function for hash operator %u",
hashop);
fmgr_info(left_hashfn, &hashtable->outer_hashfunctions[i]);
+ InitFunctionCallInfoData(hashtable->outer_hashfunctioncalls[i],
+ &hashtable->outer_hashfunctions[i],
+ 1, InvalidOid, NULL, NULL);
fmgr_info(right_hashfn, &hashtable->inner_hashfunctions[i]);
+ InitFunctionCallInfoData(hashtable->inner_hashfunctioncalls[i],
+ &hashtable->inner_hashfunctions[i],
+ 1, InvalidOid, NULL, NULL);
hashtable->hashStrict[i] = op_strict(hashop);
i++;
}
uint32 *hashvalue)
{
uint32 hashkey = 0;
- FmgrInfo *hashfunctions;
+ FunctionCallInfo hashfunctions;
ListCell *hk;
int i = 0;
MemoryContext oldContext;
oldContext = MemoryContextSwitchTo(econtext->ecxt_per_tuple_memory);
if (outer_tuple)
- hashfunctions = hashtable->outer_hashfunctions;
+ hashfunctions = hashtable->outer_hashfunctioncalls;
else
- hashfunctions = hashtable->inner_hashfunctions;
+ hashfunctions = hashtable->inner_hashfunctioncalls;
foreach(hk, hashkeys)
{
{
/* Compute the hash function */
uint32 hkey;
-
- hkey = DatumGetUInt32(FunctionCall1(&hashfunctions[i], keyval));
+ hashfunctions->arg[0] = keyval;
+ hkey = DatumGetUInt32(FunctionCallInvoke(hashfunctions));
hashkey ^= hkey;
}
i++;
+ hashfunctions++;
}
MemoryContextSwitchTo(oldContext);