Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 98c5b19

Browse files
committed
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
1 parent e839c8e commit 98c5b19

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/backend/utils/adt/like_support.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,13 +1500,11 @@ pattern_char_isalpha(char c, bool is_multibyte,
15001500
return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
15011501
else if (is_multibyte && IS_HIGHBIT_SET(c))
15021502
return true;
1503-
else if (locale->provider == COLLPROVIDER_ICU)
1503+
else if (locale->provider != COLLPROVIDER_LIBC)
15041504
return IS_HIGHBIT_SET(c) ||
15051505
(c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
1506-
else if (locale->provider == COLLPROVIDER_LIBC)
1507-
return isalpha_l((unsigned char) c, locale->info.lt);
15081506
else
1509-
return isalpha((unsigned char) c);
1507+
return isalpha_l((unsigned char) c, locale->info.lt);
15101508
}
15111509

15121510

0 commit comments

Comments
 (0)