您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GETQUERY函数代码示例

51自学网 2021-06-01 20:50:46
  C++
这篇教程C++ GETQUERY函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中GETQUERY函数的典型用法代码示例。如果您正苦于以下问题:C++ GETQUERY函数的具体用法?C++ GETQUERY怎么用?C++ GETQUERY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了GETQUERY函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: to_tsquery

Datumto_tsquery(PG_FUNCTION_ARGS){	text	   *in = PG_GETARG_TEXT_P(1);	char	   *str;	QUERYTYPE  *query;	ITEM	   *res;	int4		len;	SET_FUNCOID();	str = text2char(in);	PG_FREE_IF_COPY(in, 1);	query = queryin(str, pushval_morph, PG_GETARG_INT32(0));	res = clean_fakeval_v2(GETQUERY(query), &len);	if (!res)	{		query->len = HDRSIZEQT;		query->size = 0;		PG_RETURN_POINTER(query);	}	memcpy((void *) GETQUERY(query), (void *) res, len * sizeof(ITEM));	pfree(res);	PG_RETURN_POINTER(query);}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:26,


示例2: gin_ts_consistent

Datumgin_ts_consistent(PG_FUNCTION_ARGS){	bool	   *check = (bool *) PG_GETARG_POINTER(0);	QUERYTYPE  *query = (QUERYTYPE *) PG_DETOAST_DATUM(PG_GETARG_DATUM(2));	bool		res = FALSE;	if (query->size > 0)	{		int4		i,					j = 0;		ITEM	   *item;		GinChkVal	gcv;		gcv.frst = item = GETQUERY(query);		gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);		for (i = 0; i < query->size; i++)			if (item[i].type == VAL)				gcv.mapped_check[i] = check[j++];		res = TS_execute(						 GETQUERY(query),						 &gcv,						 true,						 checkcondition_gin			);	}	PG_FREE_IF_COPY(query, 2);	PG_RETURN_BOOL(res);}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:34,


示例3: gin_bool_consistent

boolgin_bool_consistent(QUERYTYPE *query, bool *check){	GinChkVal	gcv;	ITEM	   *items = GETQUERY(query);	int			i,				j = 0;	if (query->size <= 0)		return FALSE;	/*	 * Set up data for checkcondition_gin.  This must agree with the	 * query extraction code in ginint4_queryextract.	 */	gcv.first = items;	gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);	for (i = 0; i < query->size; i++)	{		if (items[i].type == VAL)			gcv.mapped_check[i] = check[j++];	}	return execute(GETQUERY(query) + query->size - 1,				   (void *) &gcv, true,				   checkcondition_gin);}
开发者ID:cbbrowne,项目名称:postgres,代码行数:27,


示例4: CompareTSQ

static intCompareTSQ(TSQuery a, TSQuery b){	if (a->size != b->size)	{		return (a->size < b->size) ? -1 : 1;	}	else if (VARSIZE(a) != VARSIZE(b))	{		return (VARSIZE(a) < VARSIZE(b)) ? -1 : 1;	}	else if (a->size != 0)	{		QTNode	   *an = QT2QTN(GETQUERY(a), GETOPERAND(a));		QTNode	   *bn = QT2QTN(GETQUERY(b), GETOPERAND(b));		int			res = QTNodeCompare(an, bn);		QTNFree(an);		QTNFree(bn);		return res;	}	return 0;}
开发者ID:winlibs,项目名称:postgresql,代码行数:25,


示例5: cleanup_tsquery_stopwords

/* * Remove QI_VALSTOP (stopword) nodes from TSQuery. */TSQuerycleanup_tsquery_stopwords(TSQuery in){	int32		len,				lenstr,				commonlen,				i;	NODE	   *root;	int			ladd,				radd;	TSQuery		out;	QueryItem  *items;	char	   *operands;	if (in->size == 0)		return in;	/* eliminate stop words */	root = clean_stopword_intree(maketree(GETQUERY(in)), &ladd, &radd);	if (root == NULL)	{		ereport(NOTICE,				(errmsg("text-search query contains only stop words or doesn't contain lexemes, ignored")));		out = palloc(HDRSIZETQ);		out->size = 0;		SET_VARSIZE(out, HDRSIZETQ);		return out;	}	/*	 * Build TSQuery from plain view	 */	lenstr = calcstrlen(root);	items = plaintree(root, &len);	commonlen = COMPUTESIZE(len, lenstr);	out = palloc(commonlen);	SET_VARSIZE(out, commonlen);	out->size = len;	memcpy(GETQUERY(out), items, len * sizeof(QueryItem));	items = GETQUERY(out);	operands = GETOPERAND(out);	for (i = 0; i < out->size; i++)	{		QueryOperand *op = (QueryOperand *) &items[i];		if (op->type != QI_VAL)			continue;		memcpy(operands, GETOPERAND(in) + op->distance, op->length);		operands[op->length] = '/0';		op->distance = operands - GETOPERAND(out);		operands += op->length + 1;	}	return out;}
开发者ID:winlibs,项目名称:postgresql,代码行数:63,


示例6: gin_tsquery_consistent

datum_t gin_tsquery_consistent(PG_FUNC_ARGS){	bool *check = (bool *) ARG_POINTER(0);	/* strat_nr_t strategy = ARG_UINT16(1); */	TSQuery query = ARG_TSQUERY(2);	/* int32 nkeys = ARG_INT32(3); */	pointer_p *extra_data = (pointer_p *) ARG_POINTER(4);	bool *recheck = (bool *) ARG_POINTER(5);	bool res = FALSE;	/* The query requires recheck only if it involves weights */	*recheck = false;	if (query->size > 0) {		QueryItem *item;		GinChkVal gcv;		/*		 * check-parameter array has one entry for each value (operand) in the		 * query.		 */		gcv.first_item = item = GETQUERY(query);		gcv.check = check;		gcv.map_item_operand = (int *)(extra_data[0]);		gcv.need_recheck = recheck;		res = TS_execute(GETQUERY(query), &gcv, true, checkcondition_gin);	}	RET_BOOL(res);}
开发者ID:colinet,项目名称:sqlix,代码行数:33,


示例7: gin_extract_tsquery

Datumgin_extract_tsquery(PG_FUNCTION_ARGS){	TSQuery		query = PG_GETARG_TSQUERY(0);	int32	   *nentries = (int32 *) PG_GETARG_POINTER(1);	StrategyNumber strategy = PG_GETARG_UINT16(2);	Datum	   *entries = NULL;	*nentries = 0;	if (query->size > 0)	{		int4		i,					j = 0,					len;		QueryItem  *item;		item = clean_NOT(GETQUERY(query), &len);		if (!item)			ereport(ERROR,					(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),					 errmsg("query requires full scan, which is not supported by GIN indexes")));		item = GETQUERY(query);		for (i = 0; i < query->size; i++)			if (item[i].type == QI_VAL)				(*nentries)++;		entries = (Datum *) palloc(sizeof(Datum) * (*nentries));		for (i = 0; i < query->size; i++)			if (item[i].type == QI_VAL)			{				text	   *txt;				QueryOperand *val = &item[i].operand;				txt = (text *) palloc(VARHDRSZ + val->length);				SET_VARSIZE(txt, VARHDRSZ + val->length);				memcpy(VARDATA(txt), GETOPERAND(query) + val->distance, val->length);				entries[j++] = PointerGetDatum(txt);				if (strategy != TSearchWithClassStrategyNumber && val->weight != 0)					ereport(ERROR,							(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),							 errmsg("@@ operator does not support lexeme weight restrictions in GIN index searches"),							 errhint("Use the @@@ operator instead.")));			}	}	else		*nentries = -1;			/* nothing can be found */	PG_FREE_IF_COPY(query, 0);	PG_RETURN_POINTER(entries);}
开发者ID:50wu,项目名称:gpdb,代码行数:58,


示例8: tsq_mcontains

Datumtsq_mcontains(PG_FUNCTION_ARGS){	TSQuery		query = PG_GETARG_TSQUERY(0);	TSQuery		ex = PG_GETARG_TSQUERY(1);	TSQuerySign sq,				se;	int			i,				j;	QueryItem  *iq,			   *ie;	if (query->size < ex->size)	{		PG_FREE_IF_COPY(query, 0);		PG_FREE_IF_COPY(ex, 1);		PG_RETURN_BOOL(false);	}	sq = makeTSQuerySign(query);	se = makeTSQuerySign(ex);	if ((sq & se) != se)	{		PG_FREE_IF_COPY(query, 0);		PG_FREE_IF_COPY(ex, 1);		PG_RETURN_BOOL(false);	}	iq = GETQUERY(query);	ie = GETQUERY(ex);	for (i = 0; i < ex->size; i++)	{		if (ie[i].type != QI_VAL)			continue;		for (j = 0; j < query->size; j++)		{			if (iq[j].type == QI_VAL &&				ie[i].qoperand.valcrc == iq[j].qoperand.valcrc)				break;		}		if (j >= query->size)		{			PG_FREE_IF_COPY(query, 0);			PG_FREE_IF_COPY(ex, 1);			PG_RETURN_BOOL(false);		}	}	PG_FREE_IF_COPY(query, 0);	PG_FREE_IF_COPY(ex, 1);	PG_RETURN_BOOL(true);}
开发者ID:Joe-xXx,项目名称:postgres-old-soon-decommissioned,代码行数:58,


示例9: tsquery_rewrite

Datumtsquery_rewrite(PG_FUNCTION_ARGS){	TSQuery		query = PG_GETARG_TSQUERY_COPY(0);	TSQuery		ex = PG_GETARG_TSQUERY(1);	TSQuery		subst = PG_GETARG_TSQUERY(2);	TSQuery		rewrited = query;	QTNode	   *tree,			   *qex,			   *subs = NULL;	if (query->size == 0 || ex->size == 0)	{		PG_FREE_IF_COPY(ex, 1);		PG_FREE_IF_COPY(subst, 2);		PG_RETURN_POINTER(rewrited);	}	tree = QT2QTN(GETQUERY(query), GETOPERAND(query));	QTNTernary(tree);	QTNSort(tree);	qex = QT2QTN(GETQUERY(ex), GETOPERAND(ex));	QTNTernary(qex);	QTNSort(qex);	if (subst->size)		subs = QT2QTN(GETQUERY(subst), GETOPERAND(subst));	tree = findsubquery(tree, qex, subs, NULL);	QTNFree(qex);	QTNFree(subs);	if (!tree)	{		SET_VARSIZE(rewrited, HDRSIZETQ);		rewrited->size = 0;		PG_FREE_IF_COPY(ex, 1);		PG_FREE_IF_COPY(subst, 2);		PG_RETURN_POINTER(rewrited);	}	else	{		QTNBinary(tree);		rewrited = QTN2QT(tree);		QTNFree(tree);	}	PG_FREE_IF_COPY(query, 0);	PG_FREE_IF_COPY(ex, 1);	PG_FREE_IF_COPY(subst, 2);	PG_RETURN_POINTER(rewrited);}
开发者ID:0x0FFF,项目名称:postgres,代码行数:54,


示例10: tsquery_rewrite_query

Datumtsquery_rewrite_query(PG_FUNCTION_ARGS){	QUERYTYPE  *query = (QUERYTYPE *) DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0)));	QUERYTYPE  *ex = (QUERYTYPE *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));	QUERYTYPE  *subst = (QUERYTYPE *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(2)));	QUERYTYPE  *rewrited = query;	QTNode	   *tree,			   *qex,			   *subs = NULL;	if (query->size == 0 || ex->size == 0)	{		PG_FREE_IF_COPY(ex, 1);		PG_FREE_IF_COPY(subst, 2);		PG_RETURN_POINTER(rewrited);	}	tree = QT2QTN(GETQUERY(query), GETOPERAND(query));	QTNTernary(tree);	QTNSort(tree);	qex = QT2QTN(GETQUERY(ex), GETOPERAND(ex));	QTNTernary(qex);	QTNSort(qex);	if (subst->size)		subs = QT2QTN(GETQUERY(subst), GETOPERAND(subst));	tree = findsubquery(tree, qex, PlainMemory, subs, NULL);	QTNFree(qex);	QTNFree(subs);	if (!tree)	{		rewrited->len = HDRSIZEQT;		rewrited->size = 0;		PG_FREE_IF_COPY(ex, 1);		PG_FREE_IF_COPY(subst, 2);		PG_RETURN_POINTER(rewrited);	}	else	{		QTNBinary(tree);		rewrited = QTN2QT(tree, PlainMemory);		QTNFree(tree);	}	PG_FREE_IF_COPY(query, 0);	PG_FREE_IF_COPY(ex, 1);	PG_FREE_IF_COPY(subst, 2);	PG_RETURN_POINTER(rewrited);}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:53,


示例11: gin_extract_tsquery

Datumgin_extract_tsquery(PG_FUNCTION_ARGS){	QUERYTYPE  *query = (QUERYTYPE *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));	uint32	   *nentries = (uint32 *) PG_GETARG_POINTER(1);	StrategyNumber strategy = DatumGetUInt16(PG_GETARG_DATUM(2));	Datum	   *entries = NULL;	*nentries = 0;	if (query->size > 0)	{		int4		i,					j = 0,					len;		ITEM	   *item;		item = clean_NOT_v2(GETQUERY(query), &len);		if (!item)			elog(ERROR, "Query requires full scan, GIN doesn't support it");		item = GETQUERY(query);		for (i = 0; i < query->size; i++)			if (item[i].type == VAL)				(*nentries)++;		entries = (Datum *) palloc(sizeof(Datum) * (*nentries));		for (i = 0; i < query->size; i++)			if (item[i].type == VAL)			{				text	   *txt;				txt = (text *) palloc(VARHDRSZ + item[i].length);				VARATT_SIZEP(txt) = VARHDRSZ + item[i].length;				memcpy(VARDATA(txt), GETOPERAND(query) + item[i].distance, item[i].length);				entries[j++] = PointerGetDatum(txt);				if (strategy == 1 && item[i].weight != 0)					elog(ERROR, "With class of lexeme restrictions use @@@ operation");			}	}	PG_FREE_IF_COPY(query, 0);	PG_RETURN_POINTER(entries);}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:49,


示例12: hlfinditem

static voidhlfinditem(HeadlineParsedText *prs, TSQuery query, char *buf, int buflen){	int			i;	QueryItem  *item = GETQUERY(query);	HeadlineWordEntry *word;	while (prs->curwords + query->size >= prs->lenwords)	{		prs->lenwords *= 2;		prs->words = (HeadlineWordEntry *) repalloc((void *) prs->words, prs->lenwords * sizeof(HeadlineWordEntry));	}	word = &(prs->words[prs->curwords - 1]);	for (i = 0; i < query->size; i++)	{		if (item->type == QI_VAL &&			tsCompareString(GETOPERAND(query) + item->qoperand.distance, item->qoperand.length,							buf, buflen, item->qoperand.prefix) == 0)		{			if (word->item)			{				memcpy(&(prs->words[prs->curwords]), word, sizeof(HeadlineWordEntry));				prs->words[prs->curwords].item = &item->qoperand;				prs->words[prs->curwords].repeated = 1;				prs->curwords++;			}			else				word->item = &item->qoperand;		}		item++;	}}
开发者ID:adunstan,项目名称:pg-cvs-mirror,代码行数:33,


示例13: QTN2QT

TSQueryQTN2QT(QTNode *in){	TSQuery		out;	int			len;	int			sumlen = 0,				nnode = 0;	QTN2QTState state;	cntsize(in, &sumlen, &nnode);	if (TSQUERY_TOO_BIG(nnode, sumlen))		ereport(ERROR,				(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),				 errmsg("tsquery is too large")));	len = COMPUTESIZE(nnode, sumlen);	out = (TSQuery) palloc0(len);	SET_VARSIZE(out, len);	out->size = nnode;	state.curitem = GETQUERY(out);	state.operand = state.curoperand = GETOPERAND(out);	fillQT(&state, in);	return out;}
开发者ID:5A68656E67,项目名称:postgres,代码行数:27,


示例14: hlfinditem

static voidhlfinditem(HLPRSTEXT * prs, QUERYTYPE * query, char *buf, int buflen){    int			i;    ITEM	   *item = GETQUERY(query);    HLWORD	   *word;    while (prs->curwords + query->size >= prs->lenwords)    {        prs->lenwords *= 2;        prs->words = (HLWORD *) repalloc((void *) prs->words, prs->lenwords * sizeof(HLWORD));    }    word = &(prs->words[prs->curwords - 1]);    for (i = 0; i < query->size; i++)    {        if (item->type == VAL && item->length == buflen && strncmp(GETOPERAND(query) + item->distance, buf, buflen) == 0)        {            if (word->item)            {                memcpy(&(prs->words[prs->curwords]), word, sizeof(HLWORD));                prs->words[prs->curwords].item = item;                prs->words[prs->curwords].repeated = 1;                prs->curwords++;            }            else                word->item = item;        }        item++;    }}
开发者ID:merlintang,项目名称:sgb,代码行数:31,


示例15: tsquery_not

Datumtsquery_not(PG_FUNCTION_ARGS){	TSQuery		a = PG_GETARG_TSQUERY_COPY(0);	QTNode	   *res;	TSQuery		query;	if (a->size == 0)		PG_RETURN_POINTER(a);	res = (QTNode *) palloc0(sizeof(QTNode));	res->flags |= QTN_NEEDFREE;	res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));	res->valnode->type = QI_OPR;	res->valnode->qoperator.oper = OP_NOT;	res->child = (QTNode **) palloc0(sizeof(QTNode *));	res->child[0] = QT2QTN(GETQUERY(a), GETOPERAND(a));	res->nchild = 1;	query = QTN2QT(res);	QTNFree(res);	PG_FREE_IF_COPY(a, 0);	PG_RETURN_POINTER(query);}
开发者ID:winlibs,项目名称:postgresql,代码行数:29,


示例16: query_has_required_values

boolquery_has_required_values(QUERYTYPE *query){	if (query->size <= 0)		return false;	return contains_required_value(GETQUERY(query) + query->size - 1);}
开发者ID:cbbrowne,项目名称:postgres,代码行数:7,


示例17: ts_match_vq

Datumts_match_vq(PG_FUNCTION_ARGS){	TSVector	val = PG_GETARG_TSVECTOR(0);	TSQuery		query = PG_GETARG_TSQUERY(1);	CHKVAL		chkval;	bool		result;	if (!val->size || !query->size)	{		PG_FREE_IF_COPY(val, 0);		PG_FREE_IF_COPY(query, 1);		PG_RETURN_BOOL(false);	}	chkval.arrb = ARRPTR(val);	chkval.arre = chkval.arrb + val->size;	chkval.values = STRPTR(val);	chkval.operand = GETOPERAND(query);	result = TS_execute(						GETQUERY(query),						&chkval,						true,						checkcondition_str		);	PG_FREE_IF_COPY(val, 0);	PG_FREE_IF_COPY(query, 1);	PG_RETURN_BOOL(result);}
开发者ID:bocap,项目名称:postgres,代码行数:30,


示例18: boolop

Datumboolop(PG_FUNCTION_ARGS){	ArrayType  *val = (ArrayType *) PG_DETOAST_DATUM_COPY(PG_GETARG_POINTER(0));	QUERYTYPE  *query = (QUERYTYPE *) PG_DETOAST_DATUM(PG_GETARG_POINTER(1));	CHKVAL		chkval;	bool		result;	CHECKARRVALID(val);	if (ARRISVOID(val))	{		pfree(val);		PG_FREE_IF_COPY(query, 1);		PG_RETURN_BOOL(false);	}	PREPAREARR(val);	chkval.arrb = ARRPTR(val);	chkval.arre = chkval.arrb + ARRNELEMS(val);	result = execute(					 GETQUERY(query) + query->size - 1,					 &chkval, true,					 checkcondition_arr		);	pfree(val);	PG_FREE_IF_COPY(query, 1);	PG_RETURN_BOOL(result);}
开发者ID:markwkm,项目名称:postgres,代码行数:29,


示例19: calc_rank

static floatcalc_rank(float *w, tsvector * t, QUERYTYPE * q, int4 method){	ITEM	   *item = GETQUERY(q);	float		res = 0.0;	int			len;	if (!t->size || !q->size)		return 0.0;	res = (item->type != VAL && item->val == (int4) '&') ?		calc_rank_and(w, t, q) : calc_rank_or(w, t, q);	if (res < 0)		res = 1e-20;	if ((method & RANK_NORM_LOGLENGTH) && t->size > 0)		res /= log((double) (cnt_length(t) + 1)) / log(2.0);	if (method & RANK_NORM_LENGTH)	{		len = cnt_length(t);		if (len > 0)			res /= (float) len;	}	if ((method & RANK_NORM_UNIQ) && t->size > 0)		res /= (float) (t->size);	if ((method & RANK_NORM_LOGUNIQ) && t->size > 0)		res /= log((double) (t->size + 1)) / log(2.0);	return res;}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:34,


示例20: exectsq

Datumexectsq(PG_FUNCTION_ARGS){	tsvector   *val = (tsvector *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(0)));	QUERYTYPE  *query = (QUERYTYPE *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(1)));	CHKVAL		chkval;	bool		result;	SET_FUNCOID();	if (!val->size || !query->size)	{		PG_FREE_IF_COPY(val, 0);		PG_FREE_IF_COPY(query, 1);		PG_RETURN_BOOL(false);	}	chkval.arrb = ARRPTR(val);	chkval.arre = chkval.arrb + val->size;	chkval.values = STRPTR(val);	chkval.operand = GETOPERAND(query);	result = TS_execute(						GETQUERY(query),						&chkval,						true,						checkcondition_str		);	PG_FREE_IF_COPY(val, 0);	PG_FREE_IF_COPY(query, 1);	PG_RETURN_BOOL(result);}
开发者ID:berkeley-cs186,项目名称:course-fa07,代码行数:31,


示例21: signconsistent

/* * signconsistent & execconsistent called by *_consistent */boolsignconsistent(QUERYTYPE *query, BITVEC sign, bool calcnot){	return execute(GETQUERY(query) + query->size - 1,				   (void *) sign, calcnot,				   checkcondition_bit);}
开发者ID:cbbrowne,项目名称:postgres,代码行数:10,


示例22: pzalloc

static QTNode *join_tsqueries(TSQuery a, TSQuery b, int8 operator){	QTNode *res = (QTNode *) pzalloc(sizeof(QTNode));	res->flags |= QTN_NEEDFREE;	res->valnode = (QueryItem *) pzalloc(sizeof(QueryItem));	res->valnode->type = QI_OPR;	res->valnode->qoperator.oper = operator;	res->child = (QTNode **) pzalloc(sizeof(QTNode *) * 2);	res->child[0] = QT2QTN(GETQUERY(b), GETOPERAND(b));	res->child[1] = QT2QTN(GETQUERY(a), GETOPERAND(a));	res->nchild = 2;	return res;}
开发者ID:colinet,项目名称:sqlix,代码行数:17,


示例23: to_tsquery_byid

Datumto_tsquery_byid(PG_FUNCTION_ARGS){	Oid			cfgid = PG_GETARG_OID(0);	text	   *in = PG_GETARG_TEXT_P(1);	TSQuery		query;	QueryItem  *res;	int4		len;	query = parse_tsquery(text_to_cstring(in), pushval_morph, ObjectIdGetDatum(cfgid), false);	if (query->size == 0)		PG_RETURN_TSQUERY(query);	/* clean out any stopword placeholders from the tree */	res = clean_fakeval(GETQUERY(query), &len);	if (!res)	{		SET_VARSIZE(query, HDRSIZETQ);		query->size = 0;		PG_RETURN_POINTER(query);	}	memcpy((void *) GETQUERY(query), (void *) res, len * sizeof(QueryItem));	/*	 * Removing the stopword placeholders might've resulted in fewer	 * QueryItems. If so, move the operands up accordingly.	 */	if (len != query->size)	{		char	   *oldoperand = GETOPERAND(query);		int4		lenoperand = VARSIZE(query) - (oldoperand - (char *) query);		Assert(len < query->size);		query->size = len;		memmove((void *) GETOPERAND(query), oldoperand, VARSIZE(query) - (oldoperand - (char *) query));		SET_VARSIZE(query, COMPUTESIZE(len, lenoperand));	}	pfree(res);	PG_RETURN_TSQUERY(query);}
开发者ID:mintuhouse,项目名称:postgresql-tuning,代码行数:43,


示例24: join_tsqueries

static QTNode *join_tsqueries(TSQuery a, TSQuery b, int8 operator, uint16 distance){	QTNode	   *res = (QTNode *) palloc0(sizeof(QTNode));	res->flags |= QTN_NEEDFREE;	res->valnode = (QueryItem *) palloc0(sizeof(QueryItem));	res->valnode->type = QI_OPR;	res->valnode->qoperator.oper = operator;	if (operator == OP_PHRASE)		res->valnode->qoperator.distance = distance;	res->child = (QTNode **) palloc0(sizeof(QTNode *) * 2);	res->child[0] = QT2QTN(GETQUERY(b), GETOPERAND(b));	res->child[1] = QT2QTN(GETQUERY(a), GETOPERAND(a));	res->nchild = 2;	return res;}
开发者ID:winlibs,项目名称:postgresql,代码行数:20,


示例25: execconsistent

/* Array must be sorted! */boolexecconsistent(QUERYTYPE *query, ArrayType *array, bool calcnot){	CHKVAL		chkval;	CHECKARRVALID(array);	chkval.arrb = ARRPTR(array);	chkval.arre = chkval.arrb + ARRNELEMS(array);	return execute(GETQUERY(query) + query->size - 1,				   (void *) &chkval, calcnot,				   checkcondition_arr);}
开发者ID:cbbrowne,项目名称:postgres,代码行数:13,


示例26: gin_tsquery_triconsistent

Datumgin_tsquery_triconsistent(PG_FUNCTION_ARGS){	GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0);	/* StrategyNumber strategy = PG_GETARG_UINT16(1); */	TSQuery		query = PG_GETARG_TSQUERY(2);	/* int32	nkeys = PG_GETARG_INT32(3); */	Pointer    *extra_data = (Pointer *) PG_GETARG_POINTER(4);	GinTernaryValue res = GIN_FALSE;	bool		recheck;	/* The query requires recheck only if it involves weights */	recheck = false;	if (query->size > 0)	{		QueryItem  *item;		GinChkVal	gcv;		/*		 * check-parameter array has one entry for each value (operand) in the		 * query.		 */		gcv.first_item = item = GETQUERY(query);		gcv.check = check;		gcv.map_item_operand = (int *) (extra_data[0]);		gcv.need_recheck = &recheck;		res = TS_execute_ternary(GETQUERY(query),								 &gcv,								 checkcondition_gin);		if (res == GIN_TRUE && recheck)			res = GIN_MAYBE;	}	PG_RETURN_GIN_TERNARY_VALUE(res);}
开发者ID:EccentricLoggers,项目名称:peloton,代码行数:40,


示例27: gin_tsquery_consistent

Datumgin_tsquery_consistent(PG_FUNCTION_ARGS){	bool	   *check = (bool *) PG_GETARG_POINTER(0);	/* StrategyNumber strategy = PG_GETARG_UINT16(1); */	TSQuery		query = PG_GETARG_TSQUERY(2);	bool		res = FALSE;	if (query->size > 0)	{		int			i,					j = 0;		QueryItem  *item;		GinChkVal	gcv;		/*		 * check-parameter array has one entry for each value (operand) in the		 * query. We expand that array into mapped_check, so that there's one		 * entry in mapped_check for every node in the query, including		 * operators, to allow quick lookups in checkcondition_gin. Only the		 * entries corresponding operands are actually used.		 */		gcv.frst = item = GETQUERY(query);		gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);		for (i = 0; i < query->size; i++)			if (item[i].type == QI_VAL)				gcv.mapped_check[i] = check[j++];		res = TS_execute(						 GETQUERY(query),						 &gcv,						 true,						 checkcondition_gin			);	}	PG_RETURN_BOOL(res);}
开发者ID:50wu,项目名称:gpdb,代码行数:40,


示例28: gin_tsquery_consistent

Datumgin_tsquery_consistent(PG_FUNCTION_ARGS){	bool	   *check = (bool *) PG_GETARG_POINTER(0);	/* StrategyNumber strategy = PG_GETARG_UINT16(1); */	TSQuery		query = PG_GETARG_TSQUERY(2);	/* int32	nkeys = PG_GETARG_INT32(3); */	Pointer    *extra_data = (Pointer *) PG_GETARG_POINTER(4);	bool	   *recheck = (bool *) PG_GETARG_POINTER(5);	bool		res = FALSE;	/* The query requires recheck only if it involves weights */	*recheck = false;	if (query->size > 0)	{		QueryItem  *item;		GinChkVal	gcv;		/*		 * check-parameter array has one entry for each value (operand) in the		 * query.		 */		gcv.first_item = item = GETQUERY(query);		gcv.check = reinterpret_cast<char *>(check);		gcv.map_item_operand = (int *) (extra_data[0]);		gcv.need_recheck = recheck;		res = TS_execute(GETQUERY(query),						 &gcv,						 true,						 reinterpret_cast<bool (*)(void*, QueryOperand*)>(checkcondition_gin));	}	PG_RETURN_BOOL(res);}
开发者ID:EccentricLoggers,项目名称:peloton,代码行数:38,


示例29: plainto_tsquery_byid

Datumplainto_tsquery_byid(PG_FUNCTION_ARGS){	Oid			cfgid = PG_GETARG_OID(0);	text	   *in = PG_GETARG_TEXT_P(1);	TSQuery		query;	QueryItem  *res;	int4		len;	query = parse_tsquery(text_to_cstring(in), pushval_morph, ObjectIdGetDatum(cfgid), true);	if (query->size == 0)		PG_RETURN_TSQUERY(query);	res = clean_fakeval(GETQUERY(query), &len);	if (!res)	{		SET_VARSIZE(query, HDRSIZETQ);		query->size = 0;		PG_RETURN_POINTER(query);	}	memcpy((void *) GETQUERY(query), (void *) res, len * sizeof(QueryItem));	if (len != query->size)	{		char	   *oldoperand = GETOPERAND(query);		int4		lenoperand = VARSIZE(query) - (oldoperand - (char *) query);		Assert(len < query->size);		query->size = len;		memcpy((void *) GETOPERAND(query), oldoperand, lenoperand);		SET_VARSIZE(query, COMPUTESIZE(len, lenoperand));	}	pfree(res);	PG_RETURN_POINTER(query);}
开发者ID:a1exsh,项目名称:postgres,代码行数:38,


示例30: ginconsistent

boolginconsistent(QUERYTYPE *query, bool *check){	GinChkVal	gcv;	ITEM	   *items = GETQUERY(query);	int			i,				j = 0;	if (query->size < 0)		return FALSE;	gcv.first = items;	gcv.mapped_check = (bool *) palloc(sizeof(bool) * query->size);	for (i = 0; i < query->size; i++)		if (items[i].type == VAL)			gcv.mapped_check[i] = check[j++];	return execute(				   GETQUERY(query) + query->size - 1,				   (void *) &gcv, true,				   checkcondition_gin		);}
开发者ID:markwkm,项目名称:postgres,代码行数:23,



注:本文中的GETQUERY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ GETREG函数代码示例
C++ GETPC函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。