mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-04 03:30:56 +08:00
Switched to scanner_isspace for Postgres 17+ - resolves #942
This commit is contained in:
@@ -23,6 +23,10 @@
|
||||
#include "varatt.h"
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM >= 170000
|
||||
#include "parser/scansup.h"
|
||||
#endif
|
||||
|
||||
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
|
||||
#define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))
|
||||
|
||||
@@ -133,9 +137,9 @@ InitHalfVector(int dim)
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for whitespace, since array_isspace() is static
|
||||
*/
|
||||
#if PG_VERSION_NUM >= 170000
|
||||
#define halfvec_isspace(ch) scanner_isspace(ch)
|
||||
#else
|
||||
static inline bool
|
||||
halfvec_isspace(char ch)
|
||||
{
|
||||
@@ -148,6 +152,7 @@ halfvec_isspace(char ch)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check state array
|
||||
|
||||
Reference in New Issue
Block a user