mirror of
https://github.com/postgres/postgres.git
synced 2025-12-22 17:42:17 +03:00
Fix t_isspace(), etc., when datlocprovider=i and datctype=C.
Check whether the datctype is C to determine whether t_isspace() and related functions use isspace() or iswspace(). Previously, t_isspace() checked whether the database default collation was C; which is incorrect when the default collation uses the ICU provider. Discussion: https://postgr.es/m/79e4354d9eccfdb00483146a6b9f6295202e7890.camel@j-davis.com Reviewed-by: Peter Eisentraut Backpatch-through: 15
This commit is contained in:
@@ -107,6 +107,9 @@ char *localized_full_days[7 + 1];
|
||||
char *localized_abbrev_months[12 + 1];
|
||||
char *localized_full_months[12 + 1];
|
||||
|
||||
/* is the databases's LC_CTYPE the C locale? */
|
||||
bool database_ctype_is_c = false;
|
||||
|
||||
/* indicates whether locale information cache is valid */
|
||||
static bool CurrentLocaleConvValid = false;
|
||||
static bool CurrentLCTimeValid = false;
|
||||
|
||||
@@ -419,6 +419,10 @@ CheckMyDatabase(const char *name, bool am_superuser, bool override_allow_connect
|
||||
" which is not recognized by setlocale().", ctype),
|
||||
errhint("Recreate the database with another locale or install the missing locale.")));
|
||||
|
||||
if (strcmp(ctype, "C") == 0 ||
|
||||
strcmp(ctype, "POSIX") == 0)
|
||||
database_ctype_is_c = true;
|
||||
|
||||
if (dbform->datlocprovider == COLLPROVIDER_ICU)
|
||||
{
|
||||
char *icurules;
|
||||
|
||||
Reference in New Issue
Block a user