mirror of
https://github.com/postgres/postgres.git
synced 2025-06-13 07:41:39 +03:00
Solve the 'Turkish problem' with undesirable locale behavior for case
conversion of basic ASCII letters. Remove all uses of strcasecmp and strncasecmp in favor of new functions pg_strcasecmp and pg_strncasecmp; remove most but not all direct uses of toupper and tolower in favor of pg_toupper and pg_tolower. These functions use the same notions of case folding already developed for identifier case conversion. I left the straight locale-based folding in place for situations where we are just manipulating user data and not trying to match it to built-in strings --- for example, the SQL upper() function is still locale dependent. Perhaps this will prove not to be what's wanted, but at the moment we can initdb and pass regression tests in Turkish locale.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.16 2003/11/29 19:51:47 pgsql Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/commands/aggregatecmds.c,v 1.17 2004/05/07 00:24:57 tgl Exp $
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The "DefineFoo" routines take the parse tree and pick out the
|
||||
@ -75,21 +75,21 @@ DefineAggregate(List *names, List *parameters)
|
||||
* sfunc1, stype1, and initcond1 are accepted as obsolete
|
||||
* spellings for sfunc, stype, initcond.
|
||||
*/
|
||||
if (strcasecmp(defel->defname, "sfunc") == 0)
|
||||
if (pg_strcasecmp(defel->defname, "sfunc") == 0)
|
||||
transfuncName = defGetQualifiedName(defel);
|
||||
else if (strcasecmp(defel->defname, "sfunc1") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "sfunc1") == 0)
|
||||
transfuncName = defGetQualifiedName(defel);
|
||||
else if (strcasecmp(defel->defname, "finalfunc") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "finalfunc") == 0)
|
||||
finalfuncName = defGetQualifiedName(defel);
|
||||
else if (strcasecmp(defel->defname, "basetype") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "basetype") == 0)
|
||||
baseType = defGetTypeName(defel);
|
||||
else if (strcasecmp(defel->defname, "stype") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "stype") == 0)
|
||||
transType = defGetTypeName(defel);
|
||||
else if (strcasecmp(defel->defname, "stype1") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "stype1") == 0)
|
||||
transType = defGetTypeName(defel);
|
||||
else if (strcasecmp(defel->defname, "initcond") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "initcond") == 0)
|
||||
initval = defGetString(defel);
|
||||
else if (strcasecmp(defel->defname, "initcond1") == 0)
|
||||
else if (pg_strcasecmp(defel->defname, "initcond1") == 0)
|
||||
initval = defGetString(defel);
|
||||
else
|
||||
ereport(WARNING,
|
||||
@ -124,7 +124,7 @@ DefineAggregate(List *names, List *parameters)
|
||||
* be able to store values of the transtype. However, we can allow
|
||||
* polymorphic transtype in some cases (AggregateCreate will check).
|
||||
*/
|
||||
if (strcasecmp(TypeNameToString(baseType), "ANY") == 0)
|
||||
if (pg_strcasecmp(TypeNameToString(baseType), "ANY") == 0)
|
||||
baseTypeId = ANYOID;
|
||||
else
|
||||
baseTypeId = typenameTypeId(baseType);
|
||||
|
Reference in New Issue
Block a user