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/pl/plpython/plpython.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/pl/plpython/plpython.c') diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index 010f1e1645e..f660adf2973 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.46 2004/04/01 21:28:46 tgl Exp $ + * $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.47 2004/05/07 00:24:59 tgl Exp $ * ********************************************************************* */ @@ -443,9 +443,9 @@ PLy_trigger_handler(FunctionCallInfo fcinfo, PLyProcedure * proc) elog(ERROR, "expected trigger to return None or a String"); srv = PyString_AsString(plrv); - if (strcasecmp(srv, "SKIP") == 0) + if (pg_strcasecmp(srv, "SKIP") == 0) rv = NULL; - else if (strcasecmp(srv, "MODIFY") == 0) + else if (pg_strcasecmp(srv, "MODIFY") == 0) { TriggerData *tdata = (TriggerData *) fcinfo->context; @@ -455,7 +455,7 @@ PLy_trigger_handler(FunctionCallInfo fcinfo, PLyProcedure * proc) else elog(WARNING, "ignoring modified tuple in DELETE trigger"); } - else if (strcasecmp(srv, "OK")) + else if (pg_strcasecmp(srv, "OK") != 0) { /* * hmmm, perhaps they only read the pltcl page, not a -- cgit v1.2.3