15 #define NEXTVAL(x) ( (lquery*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
16 #define ISEQ(a,b) ( (a)->numlevel == (b)->numlevel && ltree_compare(a,b)==0 )
25 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
26 errmsg(
"cannot accept a value of type %s",
"ltree_gist")));
35 (
errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
36 errmsg(
"cannot display a value of type %s",
"ltree_gist")));
66 if (!right || left == right ||
ISEQ(left, right))
91 #define GETENTRY(vec,pos) ((ltree_gist *) DatumGetPointer((vec)->vector[(pos)].key))
205 bool isalltrue =
false;
207 for (
j = 0;
j < entryvec->
n;
j++)
213 hashing(base, curtree, siglen);
228 ((
unsigned char *) base)[
i] |= sc[
i];
240 if (isalltrue ==
false)
245 if (((
unsigned char *) base)[
i] != 0xff)
273 *penalty =
Max(cmpl, 0) +
Max(cmpr, 0);
289 ((
const RIX *)
b)->r);
315 maxoff = entryvec->
n - 1;
334 lu_l = lu_r = ru_l = ru_r = NULL;
355 ((
unsigned char *) ls)[
i] |= sc[
i];
376 ((
unsigned char *) rs)[
i] |= sc[
i];
387 if (((
unsigned char *) ls)[
i] != 0xff)
400 if (((
unsigned char *) rs)[
i] != 0xff)
449 memcpy(dst, src,
VARSIZE(src));
492 bool isexist =
false;
527 while (an > 0 && bn > 0)
599 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
600 errmsg(
"array must be one-dimensional")));
603 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
604 errmsg(
"array must not contain nulls")));
715 elog(
ERROR,
"unrecognized StrategyNumber: %d", strategy);
730 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
731 errmsg(
"siglen value must be a multiple of %d", ALIGNOF_INT)));
741 "signature length in bytes",
#define PG_GETARG_ARRAYTYPE_P(n)
bool array_contains_nulls(ArrayType *array)
int ArrayGetNItems(int ndim, const int *dims)
#define Assert(condition)
unsigned int ltree_crc32_sz(const char *buf, int size)
static void PGresult * res
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_FREE_IF_COPY(ptr, n)
#define DirectFunctionCall2(func, arg1, arg2)
#define PG_GETARG_POINTER(n)
#define PG_GETARG_UINT16(n)
#define PG_DETOAST_DATUM(datum)
#define PG_RETURN_POINTER(x)
#define PG_RETURN_BOOL(x)
#define gistentryinit(e, k, r, pg, o, l)
#define HASHVAL(val, siglen)
#define HASH(sign, val, siglen)
Datum lt_q_regex(PG_FUNCTION_ARGS)
Datum ltq_regex(PG_FUNCTION_ARGS)
bool inner_isparent(const ltree *c, const ltree *p)
#define DatumGetLtreeP(X)
#define FLG_CANLOOKSIGN(x)
#define PG_GETARG_LTXTQUERY_P(n)
PGDLLEXPORT Datum ltxtq_exec(PG_FUNCTION_ARGS)
#define LTG_RNODE(x, siglen)
#define PG_GETARG_LQUERY_P(n)
#define LTG_GETRNODE(x, siglen)
int ltree_compare(const ltree *a, const ltree *b)
#define LTREE_GET_SIGLEN()
bool ltree_execute(ITEM *curitem, void *checkval, bool calcnot, bool(*chkcond)(void *checkval, ITEM *val))
#define PG_GETARG_LTREE_P_COPY(n)
#define LQL_CANLOOKSIGN(x)
#define LTREE_SIGLEN_DEFAULT
#define LTG_LNODE(x, siglen)
#define PG_GETARG_LTREE_P(n)
#define LTG_GETLNODE(x, siglen)
Datum ltree_same(PG_FUNCTION_ARGS)
Datum ltree_picksplit(PG_FUNCTION_ARGS)
static bool gist_qe(ltree_gist *key, lquery *query, int siglen)
Datum ltree_union(PG_FUNCTION_ARGS)
Datum ltree_gist_options(PG_FUNCTION_ARGS)
Datum ltree_compress(PG_FUNCTION_ARGS)
static void hashing(BITVECP sign, ltree *t, int siglen)
static bool gist_ischild(ltree_gist *key, ltree *query, int siglen)
static int gist_tqcmp(ltree *t, lquery *q)
static void ltree_gist_relopts_validator(void *parsed_options, relopt_value *vals, int nvals)
#define GETENTRY(vec, pos)
Datum ltree_penalty(PG_FUNCTION_ARGS)
static bool gist_qtxt(ltree_gist *key, ltxtquery *query, int siglen)
Datum ltree_gist_in(PG_FUNCTION_ARGS)
ltree_gist * ltree_gist_alloc(bool isalltrue, BITVECP sign, int siglen, ltree *left, ltree *right)
Datum ltree_gist_out(PG_FUNCTION_ARGS)
static bool gist_between(ltree_gist *key, lquery *query, int siglen)
struct LtreeSignature LtreeSignature
static bool arrq_cons(ltree_gist *key, ArrayType *_query, int siglen)
PG_FUNCTION_INFO_V1(ltree_gist_in)
static bool gist_isparent(ltree_gist *key, ltree *query, int siglen)
Datum ltree_decompress(PG_FUNCTION_ARGS)
static int treekey_cmp(const void *a, const void *b)
static bool checkcondition_bit(void *cxt, ITEM *val)
Datum ltree_consistent(PG_FUNCTION_ARGS)
static ltree * copy_ltree(ltree *src)
void pfree(void *pointer)
void * palloc0(Size size)
#define OffsetNumberNext(offsetNumber)
#define FirstOffsetNumber
#define qsort(a, b, c, d)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
static Pointer DatumGetPointer(Datum X)
static unsigned hash(unsigned *uv, int n)
void init_local_reloptions(local_relopts *relopts, Size relopt_struct_size)
void register_reloptions_validator(local_relopts *relopts, relopts_validator validator)
void add_local_int_reloption(local_relopts *relopts, const char *name, const char *desc, int default_val, int min_val, int max_val, int offset)
static pg_noinline void Size size
#define BTGreaterStrategyNumber
#define BTLessStrategyNumber
#define BTEqualStrategyNumber
#define BTLessEqualStrategyNumber
#define BTGreaterEqualStrategyNumber
char name[FLEXIBLE_ARRAY_MEMBER]
char name[FLEXIBLE_ARRAY_MEMBER]
#define SET_VARSIZE(PTR, len)