98 while (i < node->nchild && j < ex->nchild)
121 if (nmatched == ex->
nchild)
172 else if (
QTNEq(node, ex))
228 for (
i = 0;
i <
root->nchild;
i++)
241 if (
root->nchild == 0)
246 else if (
root->nchild == 1 &&
root->valnode->qoperator.oper !=
OP_NOT)
269 bool DidFind =
false;
293 if (query->
size == 0)
320 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
321 errmsg(
"ts_rewrite query must return two tsquery columns")));
420 if (query->
size == 0 || ex->
size == 0)
#define Assert(condition)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
#define ereport(elevel,...)
#define PG_FREE_IF_COPY(ptr, n)
#define PG_GETARG_TEXT_PP(n)
#define PG_RETURN_POINTER(x)
void pfree(void *pointer)
void * palloc0(Size size)
MemoryContext CurrentMemoryContext
#define CHECK_FOR_INTERRUPTS()
void check_stack_depth(void)
static Pointer DatumGetPointer(Datum X)
MemoryContextSwitchTo(old_ctx)
static int cmp(const chr *x, const chr *y, size_t len)
Oid SPI_gettypeid(TupleDesc tupdesc, int fnumber)
int SPI_freeplan(SPIPlanPtr plan)
SPITupleTable * SPI_tuptable
void SPI_cursor_fetch(Portal portal, bool forward, long count)
void SPI_freetuptable(SPITupleTable *tuptable)
Portal SPI_cursor_open(const char *name, SPIPlanPtr plan, Datum *Values, const char *Nulls, bool read_only)
SPIPlanPtr SPI_prepare(const char *src, int nargs, Oid *argtypes)
void SPI_cursor_close(Portal portal)
Datum SPI_getbinval(HeapTuple tuple, TupleDesc tupdesc, int fnumber, bool *isnull)
static TSQuery DatumGetTSQuery(Datum X)
#define PG_GETARG_TSQUERY(n)
#define PG_GETARG_TSQUERY_COPY(n)
Datum tsquery_rewrite_query(PG_FUNCTION_ARGS)
static QTNode * dofindsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
static QTNode * findeq(QTNode *node, QTNode *ex, QTNode *subs, bool *isfind)
QTNode * findsubquery(QTNode *root, QTNode *ex, QTNode *subs, bool *isfind)
Datum tsquery_rewrite(PG_FUNCTION_ARGS)
void QTNClearFlags(QTNode *in, uint32 flags)
int QTNodeCompare(QTNode *an, QTNode *bn)
QTNode * QTNCopy(QTNode *in)
QTNode * QT2QTN(QueryItem *in, char *operand)
void QTNTernary(QTNode *in)
bool QTNEq(QTNode *a, QTNode *b)
TSQuery QTN2QT(QTNode *in)
void QTNBinary(QTNode *in)
#define SET_VARSIZE(PTR, len)
char * text_to_cstring(const text *t)