summaryrefslogtreecommitdiff
path: root/src/backend/access/nbtree
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/nbtree')
-rw-r--r--src/backend/access/nbtree/nbtsearch.c6
-rw-r--r--src/backend/access/nbtree/nbtutils.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/src/backend/access/nbtree/nbtsearch.c b/src/backend/access/nbtree/nbtsearch.c
index be8d958352..cb78a1bae1 100644
--- a/src/backend/access/nbtree/nbtsearch.c
+++ b/src/backend/access/nbtree/nbtsearch.c
@@ -721,10 +721,9 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
cur->sk_attno,
InvalidStrategy,
cur->sk_subtype,
+ cur->sk_func.fn_collation,
procinfo,
cur->sk_argument);
- ScanKeyEntryInitializeCollation(scankeys + i,
- cur->sk_func.fn_collation);
}
else
{
@@ -743,10 +742,9 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
cur->sk_attno,
InvalidStrategy,
cur->sk_subtype,
+ cur->sk_func.fn_collation,
cmp_proc,
cur->sk_argument);
- ScanKeyEntryInitializeCollation(scankeys + i,
- cur->sk_func.fn_collation);
}
}
}
diff --git a/src/backend/access/nbtree/nbtutils.c b/src/backend/access/nbtree/nbtutils.c
index 7ee7ebeb3c..add932d942 100644
--- a/src/backend/access/nbtree/nbtutils.c
+++ b/src/backend/access/nbtree/nbtutils.c
@@ -70,7 +70,8 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
/*
* We can use the cached (default) support procs since no cross-type
- * comparison can be needed.
+ * comparison can be needed. The cached support proc entries have
+ * the right collation for the index, too.
*/
procinfo = index_getprocinfo(rel, i + 1, BTORDER_PROC);
arg = index_getattr(itup, i + 1, itupdesc, &null);
@@ -80,6 +81,7 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
(AttrNumber) (i + 1),
InvalidStrategy,
InvalidOid,
+ procinfo->fn_collation,
procinfo,
arg);
}
@@ -118,7 +120,8 @@ _bt_mkscankey_nodata(Relation rel)
/*
* We can use the cached (default) support procs since no cross-type
- * comparison can be needed.
+ * comparison can be needed. The cached support proc entries have
+ * the right collation for the index, too.
*/
procinfo = index_getprocinfo(rel, i + 1, BTORDER_PROC);
flags = SK_ISNULL | (indoption[i] << SK_BT_INDOPTION_SHIFT);
@@ -127,6 +130,7 @@ _bt_mkscankey_nodata(Relation rel)
(AttrNumber) (i + 1),
InvalidStrategy,
InvalidOid,
+ procinfo->fn_collation,
procinfo,
(Datum) 0);
}