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

Commita0b75a4

Browse files
committed
Hash indexes had better pass the index collation to support functions, too.
Per experimentation with contrib/citext, whose hash function assumes thatit'll be passed a collation.
1 parent1abd146 commita0b75a4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/backend/access/hash/hashutil.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,13 @@ uint32
8080
_hash_datum2hashkey(Relationrel,Datumkey)
8181
{
8282
FmgrInfo*procinfo;
83+
Oidcollation;
8384

8485
/* XXX assumes index has only one attribute */
8586
procinfo=index_getprocinfo(rel,1,HASHPROC);
87+
collation=rel->rd_indcollation[0];
8688

87-
returnDatumGetUInt32(FunctionCall1(procinfo,key));
89+
returnDatumGetUInt32(FunctionCall1Coll(procinfo,collation,key));
8890
}
8991

9092
/*
@@ -98,6 +100,7 @@ uint32
98100
_hash_datum2hashkey_type(Relationrel,Datumkey,Oidkeytype)
99101
{
100102
RegProcedurehash_proc;
103+
Oidcollation;
101104

102105
/* XXX assumes index has only one attribute */
103106
hash_proc=get_opfamily_proc(rel->rd_opfamily[0],
@@ -108,8 +111,9 @@ _hash_datum2hashkey_type(Relation rel, Datum key, Oid keytype)
108111
elog(ERROR,"missing support function %d(%u,%u) for index \"%s\"",
109112
HASHPROC,keytype,keytype,
110113
RelationGetRelationName(rel));
114+
collation=rel->rd_indcollation[0];
111115

112-
returnDatumGetUInt32(OidFunctionCall1(hash_proc,key));
116+
returnDatumGetUInt32(OidFunctionCall1Coll(hash_proc,collation,key));
113117
}
114118

115119
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp