mirror of
https://github.com/postgres/postgres.git
synced 2025-11-21 00:42:43 +03:00
Simplify checks for deterministic collations.
Remove redundant checks for locale->collate_is_c now that we always
have a valid pg_locale_t.
Also, remove pg_locale_deterministic() wrapper, which is no longer
useful after commit e9931bfb75. Just check the field directly,
consistent with other fields in pg_locale_t.
Author: Andreas Karlsson
Discussion: https://postgr.es/m/60929555-4709-40a7-b136-bcb44cff5a3c@proxel.se
This commit is contained in:
@@ -151,7 +151,7 @@ GenericMatchText(const char *s, int slen, const char *p, int plen, Oid collation
|
||||
{
|
||||
pg_locale_t locale = pg_newlocale_from_collation(collation);
|
||||
|
||||
if (!pg_locale_deterministic(locale))
|
||||
if (!locale->deterministic)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("nondeterministic collations are not supported for LIKE")));
|
||||
@@ -188,7 +188,7 @@ Generic_Text_IC_like(text *str, text *pat, Oid collation)
|
||||
|
||||
locale = pg_newlocale_from_collation(collation);
|
||||
|
||||
if (!pg_locale_deterministic(locale))
|
||||
if (!locale->deterministic)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("nondeterministic collations are not supported for ILIKE")));
|
||||
|
||||
Reference in New Issue
Block a user