|
|
@ -58,7 +58,7 @@ trueConsistentFn(GinScanKey key) |
|
|
|
key->recheckCurItem = false; |
|
|
|
key->recheckCurItem = false; |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
static GinLogicValue |
|
|
|
static GinTernaryValue |
|
|
|
trueTriConsistentFn(GinScanKey key) |
|
|
|
trueTriConsistentFn(GinScanKey key) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return GIN_TRUE; |
|
|
|
return GIN_TRUE; |
|
|
@ -91,17 +91,18 @@ directBoolConsistentFn(GinScanKey key) |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* A helper function for calling a native ternary logic consistent function. |
|
|
|
* A helper function for calling a native ternary logic consistent function. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static GinLogicValue |
|
|
|
static GinTernaryValue |
|
|
|
directTriConsistentFn(GinScanKey key) |
|
|
|
directTriConsistentFn(GinScanKey key) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return DatumGetGinLogicValue(FunctionCall7Coll(key->triConsistentFmgrInfo, |
|
|
|
return DatumGetGinTernaryValue(FunctionCall7Coll( |
|
|
|
key->collation, |
|
|
|
key->triConsistentFmgrInfo, |
|
|
|
PointerGetDatum(key->entryRes), |
|
|
|
key->collation, |
|
|
|
UInt16GetDatum(key->strategy), |
|
|
|
PointerGetDatum(key->entryRes), |
|
|
|
key->query, |
|
|
|
UInt16GetDatum(key->strategy), |
|
|
|
UInt32GetDatum(key->nuserentries), |
|
|
|
key->query, |
|
|
|
PointerGetDatum(key->extra_data), |
|
|
|
UInt32GetDatum(key->nuserentries), |
|
|
|
PointerGetDatum(key->queryValues), |
|
|
|
PointerGetDatum(key->extra_data), |
|
|
|
|
|
|
|
PointerGetDatum(key->queryValues), |
|
|
|
PointerGetDatum(key->queryCategories))); |
|
|
|
PointerGetDatum(key->queryCategories))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -113,15 +114,16 @@ directTriConsistentFn(GinScanKey key) |
|
|
|
static bool |
|
|
|
static bool |
|
|
|
shimBoolConsistentFn(GinScanKey key) |
|
|
|
shimBoolConsistentFn(GinScanKey key) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GinLogicValue result; |
|
|
|
GinTernaryValue result; |
|
|
|
result = DatumGetGinLogicValue(FunctionCall7Coll(key->triConsistentFmgrInfo, |
|
|
|
result = DatumGetGinTernaryValue(FunctionCall7Coll( |
|
|
|
key->collation, |
|
|
|
key->triConsistentFmgrInfo, |
|
|
|
PointerGetDatum(key->entryRes), |
|
|
|
key->collation, |
|
|
|
UInt16GetDatum(key->strategy), |
|
|
|
PointerGetDatum(key->entryRes), |
|
|
|
key->query, |
|
|
|
UInt16GetDatum(key->strategy), |
|
|
|
UInt32GetDatum(key->nuserentries), |
|
|
|
key->query, |
|
|
|
PointerGetDatum(key->extra_data), |
|
|
|
UInt32GetDatum(key->nuserentries), |
|
|
|
PointerGetDatum(key->queryValues), |
|
|
|
PointerGetDatum(key->extra_data), |
|
|
|
|
|
|
|
PointerGetDatum(key->queryValues), |
|
|
|
PointerGetDatum(key->queryCategories))); |
|
|
|
PointerGetDatum(key->queryCategories))); |
|
|
|
if (result == GIN_MAYBE) |
|
|
|
if (result == GIN_MAYBE) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -147,7 +149,7 @@ shimBoolConsistentFn(GinScanKey key) |
|
|
|
* |
|
|
|
* |
|
|
|
* NB: This function modifies the key->entryRes array! |
|
|
|
* NB: This function modifies the key->entryRes array! |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
static GinLogicValue |
|
|
|
static GinTernaryValue |
|
|
|
shimTriConsistentFn(GinScanKey key) |
|
|
|
shimTriConsistentFn(GinScanKey key) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int nmaybe; |
|
|
|
int nmaybe; |
|
|
@ -155,7 +157,7 @@ shimTriConsistentFn(GinScanKey key) |
|
|
|
int i; |
|
|
|
int i; |
|
|
|
bool boolResult; |
|
|
|
bool boolResult; |
|
|
|
bool recheck = false; |
|
|
|
bool recheck = false; |
|
|
|
GinLogicValue curResult; |
|
|
|
GinTernaryValue curResult; |
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Count how many MAYBE inputs there are, and store their indexes in |
|
|
|
* Count how many MAYBE inputs there are, and store their indexes in |
|
|
|