diff options
| author | Tom Lane | 2004-05-07 00:24:59 +0000 |
|---|---|---|
| committer | Tom Lane | 2004-05-07 00:24:59 +0000 |
| commit | 0bd61548ab8d1ac5fee63f48ee9b384502a51ad6 (patch) | |
| tree | b0c63b75585d0c396e67a3acd204e226b13eae4b /contrib/ltree | |
| parent | 4d46274b33db52618ccf49550213b4d5ce4a7981 (diff) | |
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 'contrib/ltree')
| -rw-r--r-- | contrib/ltree/lquery_op.c | 2 | ||||
| -rw-r--r-- | contrib/ltree/ltxtquery_op.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/contrib/ltree/lquery_op.c b/contrib/ltree/lquery_op.c index 2328fcd2386..81a1b788aa2 100644 --- a/contrib/ltree/lquery_op.c +++ b/contrib/ltree/lquery_op.c @@ -91,7 +91,7 @@ checkLevel(lquery_level * curq, ltree_level * curt) for (i = 0; i < curq->numvar; i++) { - cmpptr = (curvar->flag & LVAR_INCASE) ? strncasecmp : strncmp; + cmpptr = (curvar->flag & LVAR_INCASE) ? pg_strncasecmp : strncmp; if (curvar->flag & LVAR_SUBLEXEM) { diff --git a/contrib/ltree/ltxtquery_op.c b/contrib/ltree/ltxtquery_op.c index 263f39b5e4d..1bba66954b5 100644 --- a/contrib/ltree/ltxtquery_op.c +++ b/contrib/ltree/ltxtquery_op.c @@ -54,7 +54,7 @@ checkcondition_str(void *checkval, ITEM * val) char *op = ((CHKVAL *) checkval)->operand + val->distance; int (*cmpptr) (const char *, const char *, size_t); - cmpptr = (val->flag & LVAR_INCASE) ? strncasecmp : strncmp; + cmpptr = (val->flag & LVAR_INCASE) ? pg_strncasecmp : strncmp; while (tlen > 0) { if (val->flag & LVAR_SUBLEXEM) |
