Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit474ff21

Browse files
committed
De-kludge contrib/btree_gin for collations.
Using DEFAULT_COLLATION_OID in the comparePartial functions was not onlya lame hack, but outright wrong, because the compare functions forcollation-aware types were already responding to the declared indexcollation. So comparePartial would have the wrong expectation aboutthe index's sort order, possibly leading to missing matches for prefixsearches.
1 parent78e7e20 commit474ff21

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎contrib/btree_gin/btree_gin.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include"fmgr.h"
99
#include"access/skey.h"
10-
#include"catalog/pg_collation.h"
1110
#include"utils/builtins.h"
1211
#include"utils/bytea.h"
1312
#include"utils/cash.h"
@@ -123,7 +122,7 @@ gin_compare_prefix_##type(PG_FUNCTION_ARGS)\
123122
\
124123
cmp = DatumGetInt32(DirectFunctionCall2Coll(\
125124
TypeInfo_##type.typecmp,\
126-
DEFAULT_COLLATION_OID,\
125+
PG_GET_COLLATION(),\
127126
(data->strategy == BTLessStrategyNumber ||\
128127
data->strategy == BTLessEqualStrategyNumber)\
129128
? data->datum : a,\

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp