@@ -1221,7 +1221,7 @@ text_position_setup(text *t1, text *t2, Oid collid, TextPositionState *state)
12211221 if (!lc_collate_is_c (collid ))
12221222 mylocale = pg_newlocale_from_collation (collid );
12231223
1224- if (mylocale && ! mylocale -> deterministic )
1224+ if (! pg_locale_deterministic ( mylocale ) )
12251225 ereport (ERROR ,
12261226 (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
12271227 errmsg ("nondeterministic collations are not supported for substring searches" )));
@@ -1572,8 +1572,7 @@ varstr_cmp(const char *arg1, int len1, const char *arg2, int len2, Oid collid)
15721572 result = pg_strncoll (arg1 , len1 , arg2 , len2 , mylocale );
15731573
15741574 /* Break tie if necessary. */
1575- if (result == 0 &&
1576- (!mylocale || mylocale -> deterministic ))
1575+ if (result == 0 && pg_locale_deterministic (mylocale ))
15771576 {
15781577 result = memcmp (arg1 , arg2 , Min (len1 , len2 ));
15791578 if ((result == 0 ) && (len1 != len2 ))
@@ -1628,7 +1627,7 @@ texteq(PG_FUNCTION_ARGS)
16281627 else
16291628 mylocale = pg_newlocale_from_collation (collid );
16301629
1631- if (locale_is_c || ! mylocale || mylocale -> deterministic )
1630+ if (locale_is_c || pg_locale_deterministic ( mylocale ) )
16321631 {
16331632 Datum arg1 = PG_GETARG_DATUM (0 );
16341633 Datum arg2 = PG_GETARG_DATUM (1 );
@@ -1687,7 +1686,7 @@ textne(PG_FUNCTION_ARGS)
16871686 else
16881687 mylocale = pg_newlocale_from_collation (collid );
16891688
1690- if (locale_is_c || ! mylocale || mylocale -> deterministic )
1689+ if (locale_is_c || pg_locale_deterministic ( mylocale ) )
16911690 {
16921691 Datum arg1 = PG_GETARG_DATUM (0 );
16931692 Datum arg2 = PG_GETARG_DATUM (1 );
@@ -1801,7 +1800,7 @@ text_starts_with(PG_FUNCTION_ARGS)
18011800 if (!lc_collate_is_c (collid ))
18021801 mylocale = pg_newlocale_from_collation (collid );
18031802
1804- if (mylocale && ! mylocale -> deterministic )
1803+ if (! pg_locale_deterministic ( mylocale ) )
18051804 ereport (ERROR ,
18061805 (errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
18071806 errmsg ("nondeterministic collations are not supported for substring searches" )));
@@ -2217,8 +2216,7 @@ varstrfastcmp_locale(char *a1p, int len1, char *a2p, int len2, SortSupport ssup)
22172216 result = pg_strcoll (sss -> buf1 , sss -> buf2 , sss -> locale );
22182217
22192218 /* Break tie if necessary. */
2220- if (result == 0 &&
2221- (!sss -> locale || sss -> locale -> deterministic ))
2219+ if (result == 0 && pg_locale_deterministic (sss -> locale ))
22222220 result = strcmp (sss -> buf1 , sss -> buf2 );
22232221
22242222 /* Cache result, perhaps saving an expensive strcoll() call next time */
0 commit comments