mirror of
https://github.com/postgres/postgres.git
synced 2025-08-25 20:23:07 +03:00
Refactor to introduce pg_locale_deterministic().
Avoids the need of callers to test for NULL, and also avoids the need to access the pg_locale_t structure directly. Reviewed-by: Peter Eisentraut, Peter Geoghegan Discussion: https://postgr.es/m/a581136455c940d7bd0ff482d3a2bd51af25a94f.camel%40j-davis.com
This commit is contained in:
@@ -155,7 +155,7 @@ GenericMatchText(const char *s, int slen, const char *p, int plen, Oid collation
|
||||
{
|
||||
pg_locale_t locale = pg_newlocale_from_collation(collation);
|
||||
|
||||
if (locale && !locale->deterministic)
|
||||
if (!pg_locale_deterministic(locale))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("nondeterministic collations are not supported for LIKE")));
|
||||
@@ -196,7 +196,7 @@ Generic_Text_IC_like(text *str, text *pat, Oid collation)
|
||||
else
|
||||
locale = pg_newlocale_from_collation(collation);
|
||||
|
||||
if (locale && !locale->deterministic)
|
||||
if (!pg_locale_deterministic(locale))
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("nondeterministic collations are not supported for ILIKE")));
|
||||
|
Reference in New Issue
Block a user