diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-05-07 00:24:59 +0000 |
commit | 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 (patch) | |
tree | b0c63b75585d0c396e67a3acd204e226b13eae4b /src/backend/utils/adt/float.c | |
parent | 4d46274b33db52618ccf49550213b4d5ce4a7981 (diff) | |
download | postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.tar.gz postgresql-0bd61548ab8d1ac5fee63f48ee9b384502a51ad6.zip |
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.
Diffstat (limited to 'src/backend/utils/adt/float.c')
-rw-r--r-- | src/backend/utils/adt/float.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c index a9032492155..c48af109e3e 100644 --- a/src/backend/utils/adt/float.c +++ b/src/backend/utils/adt/float.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.103 2004/04/01 23:52:18 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.104 2004/05/07 00:24:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -291,17 +291,17 @@ float4in(PG_FUNCTION_ARGS) * set ERANGE anyway...) Therefore, we check for these inputs * ourselves. */ - if (strncasecmp(num, "NaN", 3) == 0) + if (pg_strncasecmp(num, "NaN", 3) == 0) { val = get_float4_nan(); endptr = num + 3; } - else if (strncasecmp(num, "Infinity", 8) == 0) + else if (pg_strncasecmp(num, "Infinity", 8) == 0) { val = get_float4_infinity(); endptr = num + 8; } - else if (strncasecmp(num, "-Infinity", 9) == 0) + else if (pg_strncasecmp(num, "-Infinity", 9) == 0) { val = - get_float4_infinity(); endptr = num + 9; @@ -456,17 +456,17 @@ float8in(PG_FUNCTION_ARGS) * set ERANGE anyway...) Therefore, we check for these inputs * ourselves. */ - if (strncasecmp(num, "NaN", 3) == 0) + if (pg_strncasecmp(num, "NaN", 3) == 0) { val = get_float8_nan(); endptr = num + 3; } - else if (strncasecmp(num, "Infinity", 8) == 0) + else if (pg_strncasecmp(num, "Infinity", 8) == 0) { val = get_float8_infinity(); endptr = num + 8; } - else if (strncasecmp(num, "-Infinity", 9) == 0) + else if (pg_strncasecmp(num, "-Infinity", 9) == 0) { val = - get_float8_infinity(); endptr = num + 9; |