mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Prevent locale-aware handling of upper, lower, and initcap when the
locale is C. Backpatch to 8.0.X because some operating systems were throwing errors for such operations, rather than ignoring the locale when it was C.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.57 2004/12/31 22:01:22 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/adt/oracle_compat.c,v 1.58 2005/03/16 00:02:48 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -166,8 +166,8 @@ Datum
|
||||
lower(PG_FUNCTION_ARGS)
|
||||
{
|
||||
#ifdef USE_WIDE_UPPER_LOWER
|
||||
/* use wide char code only when max encoding length > one */
|
||||
if (pg_database_encoding_max_length() > 1)
|
||||
/* use wide char code only when max encoding length > 1 and ctype != C */
|
||||
if (pg_database_encoding_max_length() > 1 && !lc_ctype_is_c())
|
||||
{
|
||||
text *string = PG_GETARG_TEXT_P(0);
|
||||
text *result;
|
||||
@ -228,8 +228,8 @@ Datum
|
||||
upper(PG_FUNCTION_ARGS)
|
||||
{
|
||||
#ifdef USE_WIDE_UPPER_LOWER
|
||||
/* use wide char code only when max encoding length > one */
|
||||
if (pg_database_encoding_max_length() > 1)
|
||||
/* use wide char code only when max encoding length > 1 and ctype != C */
|
||||
if (pg_database_encoding_max_length() > 1 && !lc_ctype_is_c())
|
||||
{
|
||||
text *string = PG_GETARG_TEXT_P(0);
|
||||
text *result;
|
||||
@ -293,8 +293,8 @@ Datum
|
||||
initcap(PG_FUNCTION_ARGS)
|
||||
{
|
||||
#ifdef USE_WIDE_UPPER_LOWER
|
||||
/* use wide char code only when max encoding length > one */
|
||||
if (pg_database_encoding_max_length() > 1)
|
||||
/* use wide char code only when max encoding length > 1 and ctype != C */
|
||||
if (pg_database_encoding_max_length() > 1 && !lc_ctype_is_c())
|
||||
{
|
||||
text *string = PG_GETARG_TEXT_P(0);
|
||||
text *result;
|
||||
|
Reference in New Issue
Block a user