PostgreSQL Source Code git master
|
#include "postgres.h"
#include "catalog/pg_type.h"
#include "executor/spi.h"
#include "miscadmin.h"
#include "tsearch/ts_utils.h"
#include "utils/builtins.h"
Go to the source code of this file.
Functions | |
static QTNode * | findeq (QTNode *node, QTNode *ex, QTNode *subs, bool *isfind) |
static QTNode * | dofindsubquery (QTNode *root, QTNode *ex, QTNode *subs, bool *isfind) |
QTNode * | findsubquery (QTNode *root, QTNode *ex, QTNode *subs, bool *isfind) |
Datum | tsquery_rewrite_query (PG_FUNCTION_ARGS) |
Datum | tsquery_rewrite (PG_FUNCTION_ARGS) |
Definition at line 206 of file tsquery_rewrite.c.
References CHECK_FOR_INTERRUPTS, check_stack_depth(), dofindsubquery(), findeq(), i, j, OP_NOT, pfree(), QI_OPR, QTN_NOCHANGE, QTNFree(), and root.
Referenced by dofindsubquery(), and findsubquery().
Definition at line 35 of file tsquery_rewrite.c.
References Assert(), QTNode::child, cmp(), QTNode::flags, i, j, QTNode::nchild, OP_AND, OP_OR, QueryOperator::oper, palloc0(), pfree(), QI_OPR, QI_VAL, QueryItem::qoperand, QueryItem::qoperator, QTN_NOCHANGE, QTNCopy(), QTNEq(), QTNFree(), QTNodeCompare(), QTNSort(), QTNode::sign, QueryItem::type, QueryOperand::valcrc, and QTNode::valnode.
Referenced by dofindsubquery().
Definition at line 267 of file tsquery_rewrite.c.
References dofindsubquery(), and root.
Referenced by tsquery_rewrite(), and tsquery_rewrite_query().
Datum tsquery_rewrite | ( | PG_FUNCTION_ARGS | ) |
Definition at line 410 of file tsquery_rewrite.c.
References findsubquery(), GETOPERAND, GETQUERY, HDRSIZETQ, PG_FREE_IF_COPY, PG_GETARG_TSQUERY, PG_GETARG_TSQUERY_COPY, PG_RETURN_POINTER, QT2QTN(), QTN2QT(), QTNBinary(), QTNFree(), QTNSort(), QTNTernary(), SET_VARSIZE, TSQueryData::size, and tree.
Datum tsquery_rewrite_query | ( | PG_FUNCTION_ARGS | ) |
Definition at line 280 of file tsquery_rewrite.c.
References buf, CurrentMemoryContext, DatumGetPointer(), DatumGetTSQuery(), elog, ereport, errcode(), errmsg(), ERROR, findsubquery(), GETOPERAND, GETQUERY, HDRSIZETQ, i, MemoryContextSwitchTo(), TupleDescData::natts, pfree(), PG_FREE_IF_COPY, PG_GETARG_TEXT_PP, PG_GETARG_TSQUERY_COPY, PG_RETURN_POINTER, plan, QT2QTN(), QTN2QT(), QTN_NOCHANGE, QTNBinary(), QTNClearFlags(), QTNFree(), QTNSort(), QTNTernary(), SET_VARSIZE, TSQueryData::size, SPI_connect(), SPI_cursor_close(), SPI_cursor_fetch(), SPI_cursor_open(), SPI_finish(), SPI_freeplan(), SPI_freetuptable(), SPI_getbinval(), SPI_gettypeid(), SPI_prepare(), SPI_processed, SPI_tuptable, text_to_cstring(), tree, SPITupleTable::tupdesc, and SPITupleTable::vals.