当前位置: 首页>>代码示例>>C++>>正文


C++ PG_RETURN_BOOL函数代码示例

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


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

示例1: spherecircle_cont_poly_com_neg

 Datum spherecircle_cont_poly_com_neg (PG_FUNCTION_ARGS)
 {
   SPOLY   * poly = PG_GETARG_SPOLY( 0 ) ;
   SCIRCLE * circ = ( SCIRCLE  * ) PG_GETARG_POINTER ( 1 ) ;
   PG_RETURN_BOOL ( poly_circle_pos ( poly, circ ) != PGS_CIRCLE_CONT_POLY );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例2: weak_input_status

Datum
weak_input_status(PG_FUNCTION_ARGS)
{
	PG_RETURN_BOOL(g_weak);
}
开发者ID:adam8157,项目名称:gpdb,代码行数:5,代码来源:isn.c

示例3: g_int_consistent

/*
** The GiST Consistent method for _intments
** Should return false if for all data items x below entry,
** the predicate x op query == FALSE, where op is the oper
** corresponding to strategy in the pg_amop table.
*/
Datum
g_int_consistent(PG_FUNCTION_ARGS)
{
	GISTENTRY  *entry = (GISTENTRY *) PG_GETARG_POINTER(0);
	ArrayType  *query = PG_GETARG_ARRAYTYPE_P_COPY(1);
	StrategyNumber strategy = (StrategyNumber) PG_GETARG_UINT16(2);

	/* Oid		subtype = PG_GETARG_OID(3); */
	bool	   *recheck = (bool *) PG_GETARG_POINTER(4);
	bool		retval;

	/* this is exact except for RTSameStrategyNumber */
	*recheck = (strategy == RTSameStrategyNumber);

	if (strategy == BooleanSearchStrategy)
	{
		retval = execconsistent((QUERYTYPE *) query,
								(ArrayType *) DatumGetPointer(entry->key),
								GIST_LEAF(entry));

		pfree(query);
		PG_RETURN_BOOL(retval);
	}

	/* sort query for fast search, key is already sorted */
	CHECKARRVALID(query);
	PREPAREARR(query);

	switch (strategy)
	{
		case RTOverlapStrategyNumber:
			retval = inner_int_overlap((ArrayType *) DatumGetPointer(entry->key),
									   query);
			break;
		case RTSameStrategyNumber:
			if (GIST_LEAF(entry))
				DirectFunctionCall3(g_int_same,
									entry->key,
									PointerGetDatum(query),
									PointerGetDatum(&retval));
			else
				retval = inner_int_contains((ArrayType *) DatumGetPointer(entry->key),
											query);
			break;
		case RTContainsStrategyNumber:
		case RTOldContainsStrategyNumber:
			retval = inner_int_contains((ArrayType *) DatumGetPointer(entry->key),
										query);
			break;
		case RTContainedByStrategyNumber:
		case RTOldContainedByStrategyNumber:
			if (GIST_LEAF(entry))
				retval = inner_int_contains(query,
								  (ArrayType *) DatumGetPointer(entry->key));
			else
				retval = inner_int_overlap((ArrayType *) DatumGetPointer(entry->key),
										   query);
			break;
		default:
			retval = FALSE;
	}
	pfree(query);
	PG_RETURN_BOOL(retval);
}
开发者ID:BioBD,项目名称:Hypothetical_Indexes,代码行数:70,代码来源:_int_gist.c

示例4: ssl_is_used

Datum
ssl_is_used(PG_FUNCTION_ARGS)
{
	PG_RETURN_BOOL(MyProcPort->ssl != NULL);
}
开发者ID:kevinston,项目名称:postgres,代码行数:5,代码来源:sslinfo.c

示例5: cdb_heap_test


//.........这里部分代码省略.........

	// Now allocate nSlots arrays for the sorted ints, and an array for the counts
	values = (HeapValue *)palloc0( nToGenerate * sizeof(HeapValue));
	slotcounts = (int *)palloc0( nSlots * sizeof(int) );
	slotpositions = (int *)palloc0( nSlots * sizeof(int) );

	// Now randomly assign the values to nSlots, preserving order
	for ( i=0; i<nToGenerate; i++ )
	{
		int slot = floor( ((double)rand() / ((double)RAND_MAX + 1 )) * nSlots);
		Assert( slot >= 0 && slot < nSlots);

		values[i].source = slot;
		values[i].value = intvals + i;
		slotcounts[slot]++;
	}

	elog( DEBUG4, "Slot counts follow" );
	int sum = 0;
	for ( i=0; i<nSlots; i++ )
	{
		if ( slotcounts[i] == 0 )
		{
			ereport(NOTICE,
					(errcode(ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH),
						errmsg("Function cdb_heap_test() cannot proceed, because not all slots got values."))
					);
			result = false;
			goto end;
		}

		sum += slotcounts[i];
		elog( DEBUG4, "slotcount[%d] = %d" , i, slotcounts[i]);
	}

	elog( DEBUG4, "slotcount total = %d" , sum);

	// Now add the first element from each slot to the heap.
	for ( i=0; i<nSlots; i++ )
	{
		int index = GetNextValueForSlot( values, i, slotpositions[i], nToGenerate );
		SetCdbHeapInitialValue( cdbheap, &values[index] );
		slotpositions[i] = index+1;
	}

	// Now grab lowest element from heap, and ask for the next element from the
	// same slot
	int lastval = INT_MIN;
	int lastslot;
	for ( i=0; i<nToGenerate; i++ )
	{
		HeapValue *phv = (HeapValue *)GetLowestValueFromCdbHeap( cdbheap );
		Assert( phv != NULL );
		if ( phv->value == NULL )
		{
			ereport(NOTICE,
					(errcode(ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH),
						errmsg("Function cdb_heap_test() failed. At index %d, value was NULL",
						i ))
					);
			result = false;
			goto end;
		}

		if ( lastval > *phv->value )
		{
			ereport(NOTICE,
					(errcode(ERRCODE_MOST_SPECIFIC_TYPE_MISMATCH),
						errmsg("Function cdb_heap_test() failed. At index %d, value %d was smaller than previous value %d",
						i, *phv->value, lastval ))
					);
			result = false;
			goto end;
		}

		lastval = *phv->value;
		lastslot = phv->source;

		int index = GetNextValueForSlot( values, lastslot, slotpositions[lastslot], nToGenerate );

		if ( index == -1 )
			phv->value = NULL;
		else
		{
			phv = &values[index];
			slotpositions[lastslot] = index + 1;
		}

		MergeNewValueIntoCdbHeap( cdbheap, phv );
	}

	phv = GetLowestValueFromCdbHeap( cdbheap );
	Assert( phv != NULL && phv->value == NULL );

end:
	if ( cdbheap != NULL )
		DestroyCdbHeap( cdbheap );

	PG_RETURN_BOOL(result);
}
开发者ID:laixiong,项目名称:incubator-hawq,代码行数:101,代码来源:cdbheaptest.c

示例6: plvdate_using_easter

Datum
plvdate_using_easter (PG_FUNCTION_ARGS)
{
	PG_RETURN_BOOL(use_easter);
}
开发者ID:x00man01d,项目名称:orafce,代码行数:5,代码来源:plvdate.c

示例7: spg_text_leaf_consistent


//.........这里部分代码省略.........
	bool		res;
	int			j;

	/* all tests are exact */
	out->recheck = false;

	leafValue = DatumGetTextPP(in->leafDatum);

	if (DatumGetPointer(in->reconstructedValue))
		reconstrValue = DatumGetTextP(in->reconstructedValue);

	Assert(level == 0 ? reconstrValue == NULL :
		   VARSIZE_ANY_EXHDR(reconstrValue) == level);

	/* Reconstruct the full string represented by this leaf tuple */
	fullLen = level + VARSIZE_ANY_EXHDR(leafValue);
	if (VARSIZE_ANY_EXHDR(leafValue) == 0 && level > 0)
	{
		fullValue = VARDATA(reconstrValue);
		out->leafValue = PointerGetDatum(reconstrValue);
	}
	else
	{
		text	   *fullText = palloc(VARHDRSZ + fullLen);

		SET_VARSIZE(fullText, VARHDRSZ + fullLen);
		fullValue = VARDATA(fullText);
		if (level)
			memcpy(fullValue, VARDATA(reconstrValue), level);
		if (VARSIZE_ANY_EXHDR(leafValue) > 0)
			memcpy(fullValue + level, VARDATA_ANY(leafValue),
				   VARSIZE_ANY_EXHDR(leafValue));
		out->leafValue = PointerGetDatum(fullText);
	}

	/* Perform the required comparison(s) */
	res = true;
	for (j = 0; j < in->nkeys; j++)
	{
		StrategyNumber strategy = in->scankeys[j].sk_strategy;
		text	   *query = DatumGetTextPP(in->scankeys[j].sk_argument);
		int			queryLen = VARSIZE_ANY_EXHDR(query);
		int			r;

		if (strategy > 10)
		{
			/* Collation-aware comparison */
			strategy -= 10;

			/* If asserts enabled, verify encoding of reconstructed string */
			Assert(pg_verifymbstr(fullValue, fullLen, false));

			r = varstr_cmp(fullValue, Min(queryLen, fullLen),
						   VARDATA_ANY(query), Min(queryLen, fullLen),
						   PG_GET_COLLATION());
		}
		else
		{
			/* Non-collation-aware comparison */
			r = memcmp(fullValue, VARDATA_ANY(query), Min(queryLen, fullLen));
		}

		if (r == 0)
		{
			if (queryLen > fullLen)
				r = -1;
			else if (queryLen < fullLen)
				r = 1;
		}

		switch (strategy)
		{
			case BTLessStrategyNumber:
				res = (r < 0);
				break;
			case BTLessEqualStrategyNumber:
				res = (r <= 0);
				break;
			case BTEqualStrategyNumber:
				res = (r == 0);
				break;
			case BTGreaterEqualStrategyNumber:
				res = (r >= 0);
				break;
			case BTGreaterStrategyNumber:
				res = (r > 0);
				break;
			default:
				elog(ERROR, "unrecognized strategy number: %d",
					 in->scankeys[j].sk_strategy);
				res = false;
				break;
		}

		if (!res)
			break;				/* no need to consider remaining conditions */
	}

	PG_RETURN_BOOL(res);
}
开发者ID:BioBD,项目名称:Hypothetical_Indexes,代码行数:101,代码来源:spgtextproc.c

示例8: spherepoly_cont_ellipse_com

 Datum spherepoly_cont_ellipse_com (PG_FUNCTION_ARGS)
 {
   SELLIPSE * ell  = ( SELLIPSE * ) PG_GETARG_POINTER ( 0 ) ;
   SPOLY    * poly = PG_GETARG_SPOLY( 1 ) ;
   PG_RETURN_BOOL ( poly_ellipse_pos ( poly, ell ) == PGS_POLY_CONT_ELLIPSE );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例9: pg_is_in_backup

/*
 * Returns bool with current on-line backup mode, a global state.
 */
Datum
pg_is_in_backup(PG_FUNCTION_ARGS)
{
	PG_RETURN_BOOL(BackupInProgress());
}
开发者ID:sangli00,项目名称:postgres,代码行数:8,代码来源:xlogfuncs.c

示例10: spherepoly_cont_poly_com_neg

 Datum spherepoly_cont_poly_com_neg (PG_FUNCTION_ARGS)
 {
   SPOLY   * poly1 = PG_GETARG_SPOLY( 1 ) ;
   SPOLY   * poly2 = PG_GETARG_SPOLY( 0 ) ;
   PG_RETURN_BOOL ( poly_poly_pos ( poly1, poly2, FALSE ) !=  PGS_POLY_CONT );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例11: spherepoly_overlap_poly_neg

 Datum spherepoly_overlap_poly_neg (PG_FUNCTION_ARGS)
 {
   SPOLY   * poly1 = PG_GETARG_SPOLY( 0 ) ;
   SPOLY   * poly2 = PG_GETARG_SPOLY( 1 ) ;
   PG_RETURN_BOOL ( poly_poly_pos ( poly1, poly2, FALSE ) == PGS_POLY_AVOID );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例12: spherepoly_overlap_line_com_neg

 Datum spherepoly_overlap_line_com_neg (PG_FUNCTION_ARGS)
 {
   SPOLY   * poly = PG_GETARG_SPOLY( 1 ) ;
   SLine   * line = ( SLine * ) PG_GETARG_POINTER ( 0 ) ;
   PG_RETURN_BOOL ( poly_line_pos ( poly, line ) == PGS_LINE_POLY_AVOID );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例13: spherepoly_cont_line_com_neg

 Datum spherepoly_cont_line_com_neg (PG_FUNCTION_ARGS)
 {
   SPOLY   * poly = PG_GETARG_SPOLY( 1 ) ;
   SLine   * line = ( SLine  * ) PG_GETARG_POINTER ( 0 ) ;
   PG_RETURN_BOOL ( poly_line_pos ( poly, line ) != PGS_POLY_CONT_LINE );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例14: spherepoly_overlap_circle_com_neg

 Datum spherepoly_overlap_circle_com_neg (PG_FUNCTION_ARGS)
 {
   SPOLY   * poly = PG_GETARG_SPOLY( 1 ) ;
   SCIRCLE * circ = ( SCIRCLE  * ) PG_GETARG_POINTER ( 0 ) ;
   PG_RETURN_BOOL ( poly_circle_pos ( poly, circ ) == PGS_CIRCLE_POLY_AVOID );
 }
开发者ID:mnullmei,项目名称:pgsphere,代码行数:6,代码来源:polygon.c

示例15: gp_add_persistent_database_node_entry

Datum
gp_add_persistent_database_node_entry(PG_FUNCTION_ARGS)
{
	NYI;
	PG_RETURN_BOOL(true);
}
开发者ID:50wu,项目名称:gpdb,代码行数:6,代码来源:persistentutil.c


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