mirror of
https://github.com/pgvector/pgvector.git
synced 2026-07-07 05:00:56 +08:00
Switched to scanner_isspace for Postgres 17+ - resolves #942
This commit is contained in:
@@ -23,6 +23,10 @@
|
|||||||
#include "varatt.h"
|
#include "varatt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= 170000
|
||||||
|
#include "parser/scansup.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
|
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
|
||||||
#define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))
|
#define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))
|
||||||
|
|
||||||
@@ -133,9 +137,9 @@ InitHalfVector(int dim)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
#if PG_VERSION_NUM >= 170000
|
||||||
* Check for whitespace, since array_isspace() is static
|
#define halfvec_isspace(ch) scanner_isspace(ch)
|
||||||
*/
|
#else
|
||||||
static inline bool
|
static inline bool
|
||||||
halfvec_isspace(char ch)
|
halfvec_isspace(char ch)
|
||||||
{
|
{
|
||||||
@@ -148,6 +152,7 @@ halfvec_isspace(char ch)
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check state array
|
* Check state array
|
||||||
|
|||||||
@@ -22,6 +22,10 @@
|
|||||||
#include "varatt.h"
|
#include "varatt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= 170000
|
||||||
|
#include "parser/scansup.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct SparseInputElement
|
typedef struct SparseInputElement
|
||||||
{
|
{
|
||||||
int32 index;
|
int32 index;
|
||||||
@@ -155,9 +159,9 @@ InitSparseVector(int dim, int nnz)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
#if PG_VERSION_NUM >= 170000
|
||||||
* Check for whitespace, since array_isspace() is static
|
#define sparsevec_isspace(ch) scanner_isspace(ch)
|
||||||
*/
|
#else
|
||||||
static inline bool
|
static inline bool
|
||||||
sparsevec_isspace(char ch)
|
sparsevec_isspace(char ch)
|
||||||
{
|
{
|
||||||
@@ -170,6 +174,7 @@ sparsevec_isspace(char ch)
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compare indices
|
* Compare indices
|
||||||
|
|||||||
11
src/vector.c
11
src/vector.c
@@ -26,6 +26,10 @@
|
|||||||
#include "varatt.h"
|
#include "varatt.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if PG_VERSION_NUM >= 170000
|
||||||
|
#include "parser/scansup.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
|
#define STATE_DIMS(x) (ARR_DIMS(x)[0] - 1)
|
||||||
#define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))
|
#define CreateStateDatums(dim) palloc(sizeof(Datum) * (dim + 1))
|
||||||
|
|
||||||
@@ -129,9 +133,9 @@ InitVector(int dim)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
#if PG_VERSION_NUM >= 170000
|
||||||
* Check for whitespace, since array_isspace() is static
|
#define vector_isspace(ch) scanner_isspace(ch)
|
||||||
*/
|
#else
|
||||||
static inline bool
|
static inline bool
|
||||||
vector_isspace(char ch)
|
vector_isspace(char ch)
|
||||||
{
|
{
|
||||||
@@ -144,6 +148,7 @@ vector_isspace(char ch)
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Check state array
|
* Check state array
|
||||||
|
|||||||
Reference in New Issue
Block a user