diff options
Diffstat (limited to 'src/backend/access/gin')
| -rw-r--r-- | src/backend/access/gin/ginget.c | 6 | ||||
| -rw-r--r-- | src/backend/access/gin/ginscan.c | 17 | ||||
| -rw-r--r-- | src/backend/access/gin/ginutil.c | 21 |
3 files changed, 23 insertions, 21 deletions
diff --git a/src/backend/access/gin/ginget.c b/src/backend/access/gin/ginget.c index 227f84d988..5b35b50034 100644 --- a/src/backend/access/gin/ginget.c +++ b/src/backend/access/gin/ginget.c @@ -56,7 +56,7 @@ callConsistentFn(GinState *ginstate, GinScanKey key) key->recheckCurItem = true; return DatumGetBool(FunctionCall8Coll(&ginstate->consistentFn[key->attnum - 1], - ginstate->compareCollation[key->attnum - 1], + ginstate->supportCollation[key->attnum - 1], PointerGetDatum(key->entryRes), UInt16GetDatum(key->strategy), key->query, @@ -252,7 +252,7 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack, *---------- */ cmp = DatumGetInt32(FunctionCall4Coll(&btree->ginstate->comparePartialFn[attnum - 1], - btree->ginstate->compareCollation[attnum - 1], + btree->ginstate->supportCollation[attnum - 1], scanEntry->queryKey, idatum, UInt16GetDatum(scanEntry->strategy), @@ -1178,7 +1178,7 @@ matchPartialInPendingList(GinState *ginstate, Page page, *---------- */ cmp = DatumGetInt32(FunctionCall4Coll(&ginstate->comparePartialFn[entry->attnum - 1], - ginstate->compareCollation[entry->attnum - 1], + ginstate->supportCollation[entry->attnum - 1], entry->queryKey, datum[off - 1], UInt16GetDatum(entry->strategy), diff --git a/src/backend/access/gin/ginscan.c b/src/backend/access/gin/ginscan.c index 37b08c0df6..d9f5b8c012 100644 --- a/src/backend/access/gin/ginscan.c +++ b/src/backend/access/gin/ginscan.c @@ -305,14 +305,15 @@ ginNewScanKey(IndexScanDesc scan) /* OK to call the extractQueryFn */ queryValues = (Datum *) - DatumGetPointer(FunctionCall7(&so->ginstate.extractQueryFn[skey->sk_attno - 1], - skey->sk_argument, - PointerGetDatum(&nQueryValues), - UInt16GetDatum(skey->sk_strategy), - PointerGetDatum(&partial_matches), - PointerGetDatum(&extra_data), - PointerGetDatum(&nullFlags), - PointerGetDatum(&searchMode))); + DatumGetPointer(FunctionCall7Coll(&so->ginstate.extractQueryFn[skey->sk_attno - 1], + so->ginstate.supportCollation[skey->sk_attno - 1], + skey->sk_argument, + PointerGetDatum(&nQueryValues), + UInt16GetDatum(skey->sk_strategy), + PointerGetDatum(&partial_matches), + PointerGetDatum(&extra_data), + PointerGetDatum(&nullFlags), + PointerGetDatum(&searchMode))); /* * If bogus searchMode is returned, treat as GIN_SEARCH_MODE_ALL; note diff --git a/src/backend/access/gin/ginutil.c b/src/backend/access/gin/ginutil.c index a712331cf4..1ae51b1060 100644 --- a/src/backend/access/gin/ginutil.c +++ b/src/backend/access/gin/ginutil.c @@ -93,17 +93,17 @@ initGinState(GinState *state, Relation index) * while doing comparisons. However, we may have a collatable storage * type for a noncollatable indexed data type (for instance, hstore * uses text index entries). If there's no index collation then - * specify default collation in case the comparison function needs - * collation. This is harmless if the comparison function doesn't + * specify default collation in case the support functions need + * collation. This is harmless if the support functions don't * care about collation, so we just do it unconditionally. (We could * alternatively call get_typcollation, but that seems like expensive * overkill --- there aren't going to be any cases where a GIN storage * type has a nondefault collation.) */ if (OidIsValid(index->rd_indcollation[i])) - state->compareCollation[i] = index->rd_indcollation[i]; + state->supportCollation[i] = index->rd_indcollation[i]; else - state->compareCollation[i] = DEFAULT_COLLATION_OID; + state->supportCollation[i] = DEFAULT_COLLATION_OID; } } @@ -293,7 +293,7 @@ ginCompareEntries(GinState *ginstate, OffsetNumber attnum, /* both not null, so safe to call the compareFn */ return DatumGetInt32(FunctionCall2Coll(&ginstate->compareFn[attnum - 1], - ginstate->compareCollation[attnum - 1], + ginstate->supportCollation[attnum - 1], a, b)); } @@ -399,10 +399,11 @@ ginExtractEntries(GinState *ginstate, OffsetNumber attnum, /* OK, call the opclass's extractValueFn */ nullFlags = NULL; /* in case extractValue doesn't set it */ entries = (Datum *) - DatumGetPointer(FunctionCall3(&ginstate->extractValueFn[attnum - 1], - value, - PointerGetDatum(nentries), - PointerGetDatum(&nullFlags))); + DatumGetPointer(FunctionCall3Coll(&ginstate->extractValueFn[attnum - 1], + ginstate->supportCollation[attnum - 1], + value, + PointerGetDatum(nentries), + PointerGetDatum(&nullFlags))); /* * Generate a placeholder if the item contained no keys. @@ -453,7 +454,7 @@ ginExtractEntries(GinState *ginstate, OffsetNumber attnum, } arg.cmpDatumFunc = &ginstate->compareFn[attnum - 1]; - arg.collation = ginstate->compareCollation[attnum - 1]; + arg.collation = ginstate->supportCollation[attnum - 1]; arg.haveDups = false; qsort_arg(keydata, *nentries, sizeof(keyEntryData), cmpEntries, (void *) &arg); |
