mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
Rename GinLogicValue to GinTernaryValue.
It's more descriptive. Also, get rid of the enum, and use #defines instead, per Greg Stark's suggestion.
This commit is contained in:
@@ -225,7 +225,7 @@ ginarrayconsistent(PG_FUNCTION_ARGS)
|
||||
Datum
|
||||
ginarraytriconsistent(PG_FUNCTION_ARGS)
|
||||
{
|
||||
GinLogicValue *check = (GinLogicValue *) PG_GETARG_POINTER(0);
|
||||
GinTernaryValue *check = (GinTernaryValue *) PG_GETARG_POINTER(0);
|
||||
StrategyNumber strategy = PG_GETARG_UINT16(1);
|
||||
|
||||
/* ArrayType *query = PG_GETARG_ARRAYTYPE_P(2); */
|
||||
@@ -234,7 +234,7 @@ ginarraytriconsistent(PG_FUNCTION_ARGS)
|
||||
/* Pointer *extra_data = (Pointer *) PG_GETARG_POINTER(4); */
|
||||
/* Datum *queryKeys = (Datum *) PG_GETARG_POINTER(5); */
|
||||
bool *nullFlags = (bool *) PG_GETARG_POINTER(6);
|
||||
GinLogicValue res;
|
||||
GinTernaryValue res;
|
||||
int32 i;
|
||||
|
||||
switch (strategy)
|
||||
@@ -300,5 +300,5 @@ ginarraytriconsistent(PG_FUNCTION_ARGS)
|
||||
res = false;
|
||||
}
|
||||
|
||||
PG_RETURN_GIN_LOGIC_VALUE(res);
|
||||
PG_RETURN_GIN_TERNARY_VALUE(res);
|
||||
}
|
||||
|
||||
@@ -873,7 +873,7 @@ keyGetItem(GinState *ginstate, MemoryContext tempCtx, GinScanKey key,
|
||||
uint32 i;
|
||||
bool haveLossyEntry;
|
||||
GinScanEntry entry;
|
||||
GinLogicValue res;
|
||||
GinTernaryValue res;
|
||||
MemoryContext oldCtx;
|
||||
bool allFinished;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ trueConsistentFn(GinScanKey key)
|
||||
key->recheckCurItem = false;
|
||||
return true;
|
||||
}
|
||||
static GinLogicValue
|
||||
static GinTernaryValue
|
||||
trueTriConsistentFn(GinScanKey key)
|
||||
{
|
||||
return GIN_TRUE;
|
||||
@@ -91,17 +91,18 @@ directBoolConsistentFn(GinScanKey key)
|
||||
/*
|
||||
* A helper function for calling a native ternary logic consistent function.
|
||||
*/
|
||||
static GinLogicValue
|
||||
static GinTernaryValue
|
||||
directTriConsistentFn(GinScanKey key)
|
||||
{
|
||||
return DatumGetGinLogicValue(FunctionCall7Coll(key->triConsistentFmgrInfo,
|
||||
key->collation,
|
||||
PointerGetDatum(key->entryRes),
|
||||
UInt16GetDatum(key->strategy),
|
||||
key->query,
|
||||
UInt32GetDatum(key->nuserentries),
|
||||
PointerGetDatum(key->extra_data),
|
||||
PointerGetDatum(key->queryValues),
|
||||
return DatumGetGinTernaryValue(FunctionCall7Coll(
|
||||
key->triConsistentFmgrInfo,
|
||||
key->collation,
|
||||
PointerGetDatum(key->entryRes),
|
||||
UInt16GetDatum(key->strategy),
|
||||
key->query,
|
||||
UInt32GetDatum(key->nuserentries),
|
||||
PointerGetDatum(key->extra_data),
|
||||
PointerGetDatum(key->queryValues),
|
||||
PointerGetDatum(key->queryCategories)));
|
||||
}
|
||||
|
||||
@@ -113,15 +114,16 @@ directTriConsistentFn(GinScanKey key)
|
||||
static bool
|
||||
shimBoolConsistentFn(GinScanKey key)
|
||||
{
|
||||
GinLogicValue result;
|
||||
result = DatumGetGinLogicValue(FunctionCall7Coll(key->triConsistentFmgrInfo,
|
||||
key->collation,
|
||||
PointerGetDatum(key->entryRes),
|
||||
UInt16GetDatum(key->strategy),
|
||||
key->query,
|
||||
UInt32GetDatum(key->nuserentries),
|
||||
PointerGetDatum(key->extra_data),
|
||||
PointerGetDatum(key->queryValues),
|
||||
GinTernaryValue result;
|
||||
result = DatumGetGinTernaryValue(FunctionCall7Coll(
|
||||
key->triConsistentFmgrInfo,
|
||||
key->collation,
|
||||
PointerGetDatum(key->entryRes),
|
||||
UInt16GetDatum(key->strategy),
|
||||
key->query,
|
||||
UInt32GetDatum(key->nuserentries),
|
||||
PointerGetDatum(key->extra_data),
|
||||
PointerGetDatum(key->queryValues),
|
||||
PointerGetDatum(key->queryCategories)));
|
||||
if (result == GIN_MAYBE)
|
||||
{
|
||||
@@ -147,7 +149,7 @@ shimBoolConsistentFn(GinScanKey key)
|
||||
*
|
||||
* NB: This function modifies the key->entryRes array!
|
||||
*/
|
||||
static GinLogicValue
|
||||
static GinTernaryValue
|
||||
shimTriConsistentFn(GinScanKey key)
|
||||
{
|
||||
int nmaybe;
|
||||
@@ -155,7 +157,7 @@ shimTriConsistentFn(GinScanKey key)
|
||||
int i;
|
||||
bool boolResult;
|
||||
bool recheck = false;
|
||||
GinLogicValue curResult;
|
||||
GinTernaryValue curResult;
|
||||
|
||||
/*
|
||||
* Count how many MAYBE inputs there are, and store their indexes in
|
||||
|
||||
Reference in New Issue
Block a user