22 #define NEXTVAL(x) ( (lquery*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
36 while (ptr < end && !
t_iseq(ptr,
'_'))
47 char *endq = qn +
len;
53 while ((qn =
getlexeme(qn, endq, &lenq)) != NULL)
57 while ((tn =
getlexeme(tn, endt, &lent)) != NULL)
59 if ((lent == lenq || (lent > lenq && anyend)) &&
60 (*cmpptr) (qn, tn, lenq) == 0)
84 res = strncmp(al, bl, s);
112 int (*cmpptr) (
const char *,
const char *, size_t);
122 else if ((curvar->
len == curt->
len ||
124 (*cmpptr) (curvar->
name, curt->
name, curvar->
len) == 0)
158 low = curq->
low, high = curq->
high;
180 for (
int matchcnt = 0; matchcnt < high; matchcnt++)
186 if (matchcnt >= low &&
checkCond(nextq, qlen, curt, tlen))
249 (
errcode(ERRCODE_ARRAY_SUBSCRIPT_ERROR),
250 errmsg(
"array must be one-dimensional")));
253 (
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED),
254 errmsg(
"array must not contain nulls")));
#define PG_GETARG_ARRAYTYPE_P(n)
bool array_contains_nulls(ArrayType *array)
int ArrayGetNItems(int ndim, const int *dims)
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_DATUM(n)
#define PG_RETURN_DATUM(x)
#define PG_RETURN_BOOL(x)
PG_FUNCTION_INFO_V1(ltq_regex)
static char * getlexeme(char *start, char *end, int *len)
Datum lt_q_rregex(PG_FUNCTION_ARGS)
bool compare_subnode(ltree_level *t, char *qn, int len, int(*cmpptr)(const char *, const char *, size_t), bool anyend)
static bool checkCond(lquery_level *curq, int qlen, ltree_level *curt, int tlen)
int ltree_strncasecmp(const char *a, const char *b, size_t s)
Datum lt_q_regex(PG_FUNCTION_ARGS)
Datum ltq_regex(PG_FUNCTION_ARGS)
static bool checkLevel(lquery_level *curq, ltree_level *curt)
Datum ltq_rregex(PG_FUNCTION_ARGS)
#define PG_GETARG_LQUERY_P(n)
#define PG_GETARG_LTREE_P(n)
int pg_mblen(const char *mbstr)
void pfree(void *pointer)
#define CHECK_FOR_INTERRUPTS()
void check_stack_depth(void)
static bool DatumGetBool(Datum X)
static Datum PointerGetDatum(const void *X)
char name[FLEXIBLE_ARRAY_MEMBER]
char name[FLEXIBLE_ARRAY_MEMBER]