mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-01 02:02:10 +08:00
Restored isnan check [skip ci]
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "postgres.h"
|
||||
|
||||
#include <float.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "access/generic_xlog.h"
|
||||
@@ -573,7 +574,14 @@ HnswLoadElementImpl(BlockNumber blkno, OffsetNumber offno, float *distance, Datu
|
||||
if (DatumGetPointer(*q) == NULL)
|
||||
*distance = 0;
|
||||
else
|
||||
{
|
||||
*distance = (float) DatumGetFloat8(FunctionCall2Coll(procinfo, collation, *q, PointerGetDatum(&etup->data)));
|
||||
|
||||
/* Needed for intvec cosine distance */
|
||||
/* TODO Improve */
|
||||
if (isnan(*distance))
|
||||
*distance = FLT_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
/* Load element */
|
||||
|
||||
@@ -110,7 +110,7 @@ intvec_in(PG_FUNCTION_ARGS)
|
||||
int8 x[INTVEC_MAX_DIM];
|
||||
int dim = 0;
|
||||
char *pt = lit;
|
||||
IntVector *result;
|
||||
IntVector *result;
|
||||
|
||||
while (intvec_isspace(*pt))
|
||||
pt++;
|
||||
|
||||
Reference in New Issue
Block a user