Removed type-specific code from HNSW [skip ci]

This commit is contained in:
Andrew Kane
2024-04-24 14:53:45 -07:00
parent b8bdf317f0
commit 3eef1ff5c2
6 changed files with 64 additions and 83 deletions

View File

@@ -612,6 +612,7 @@ static void
HnswInsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heap_tid)
{
Datum value;
FmgrInfo *checkvalueprocinfo = HnswOptionalProcInfo(index, HNSW_CHECK_VALUE_PROC);
FmgrInfo *normprocinfo;
Oid collation = index->rd_indcollation[0];
@@ -619,7 +620,8 @@ HnswInsertTuple(Relation index, Datum *values, bool *isnull, ItemPointer heap_ti
value = PointerGetDatum(PG_DETOAST_DATUM(values[0]));
/* Check value */
HnswCheckValue(value, HnswGetType(index));
if (checkvalueprocinfo != NULL)
HnswCheckValue(checkvalueprocinfo, collation, value);
/* Normalize if needed */
normprocinfo = HnswOptionalProcInfo(index, HNSW_NORM_PROC);