From 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 7 May 2004 00:24:59 +0000 Subject: 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. --- src/backend/commands/functioncmds.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/backend/commands/functioncmds.c') diff --git a/src/backend/commands/functioncmds.c b/src/backend/commands/functioncmds.c index c91b31ed6fd..a0a9c582409 100644 --- a/src/backend/commands/functioncmds.c +++ b/src/backend/commands/functioncmds.c @@ -10,7 +10,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.44 2004/02/21 00:34:52 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.45 2004/05/07 00:24:57 tgl Exp $ * * DESCRIPTION * These routines take the parse tree and pick out the @@ -328,9 +328,9 @@ compute_attributes_with_style(List *parameters, bool *isStrict_p, char *volatili { DefElem *param = (DefElem *) lfirst(pl); - if (strcasecmp(param->defname, "isstrict") == 0) + if (pg_strcasecmp(param->defname, "isstrict") == 0) *isStrict_p = true; - else if (strcasecmp(param->defname, "iscachable") == 0) + else if (pg_strcasecmp(param->defname, "iscachable") == 0) { /* obsolete spelling of isImmutable */ *volatility_p = PROVOLATILE_IMMUTABLE; -- cgit v1.2.3