Skip to content

Commit 0bc1c4a

Browse files
committed
Fix collation check in ICU-enabled build
1 parent e375528 commit 0bc1c4a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/utils/adt/varlena.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,6 +1574,14 @@ varstr_cmp(char *arg1, int len1, char *arg2, int len2, Oid collid)
15741574
#ifdef USE_ICU
15751575
else if (pg_database_encoding_max_length() > 1)
15761576
{
1577+
/*
1578+
* check collation as it done for regular way
1579+
*/
1580+
if (collid != DEFAULT_COLLATION_OID && !OidIsValid(collid))
1581+
ereport(ERROR,
1582+
(errcode(ERRCODE_INDETERMINATE_COLLATION),
1583+
errmsg("could not determine which collation to use for string comparison"),
1584+
errhint("Use the COLLATE clause to set the collation explicitly.")));
15771585
result = strcmp_icu(arg1, len1, arg2, len2);
15781586
}
15791587
#endif

0 commit comments

Comments
 (0)