aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2024-10-11 16:57:48 -0700
committerJeff Davis <jdavis@postgresql.org>2024-10-11 16:59:29 -0700
commit98c5b191e74b65b74149bb436b057d7007d401a7 (patch)
treeab0d41df8f13a1f045c7b5057246b560d92af556
parente839c8ecc9352b7754e74f19ace013c0c0d18613 (diff)
downloadpostgresql-98c5b191e74b65b74149bb436b057d7007d401a7.tar.gz
postgresql-98c5b191e74b65b74149bb436b057d7007d401a7.zip
Fix missed case for builtin collation provider.
A missed check for the builtin collation provider could result in falling through to call isalpha(). This does not appear to have practical consequences because it only happens for characters in the ASCII range. Regardless, the builtin provider should not be calling libc functions, so backpatch. Discussion: https://postgr.es/m/1bd5a0a5192f82c22ee7527e825b18ab0028b2c7.camel@j-davis.com Backpatch-through: 17
-rw-r--r--src/backend/utils/adt/like_support.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/backend/utils/adt/like_support.c b/src/backend/utils/adt/like_support.c
index 79c4ddc7573..8b15509a3bf 100644
--- a/src/backend/utils/adt/like_support.c
+++ b/src/backend/utils/adt/like_support.c
@@ -1500,13 +1500,11 @@ pattern_char_isalpha(char c, bool is_multibyte,
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
else if (is_multibyte && IS_HIGHBIT_SET(c))
return true;
- else if (locale->provider == COLLPROVIDER_ICU)
+ else if (locale->provider != COLLPROVIDER_LIBC)
return IS_HIGHBIT_SET(c) ||
(c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
- else if (locale->provider == COLLPROVIDER_LIBC)
- return isalpha_l((unsigned char) c, locale->info.lt);
else
- return isalpha((unsigned char) c);
+ return isalpha_l((unsigned char) c, locale->info.lt);
}