diff options
author | Marc G. Fournier <scrappy@hub.org> | 1996-09-10 06:41:38 +0000 |
---|---|---|
committer | Marc G. Fournier <scrappy@hub.org> | 1996-09-10 06:41:38 +0000 |
commit | f2f53aee0f2810a935e0f86b17f8dedba3647da0 (patch) | |
tree | dc0bf697fd1ff373a7b7977d4a95898044e06e4f /src/backend/utils/adt/varlena.c | |
parent | 1ba34d91fcaf58f6e920084f246cae5dfff5468e (diff) |
Fixes:
The comparison routines for text and char data type give incorrect results
if the input data contains characters greater than 127. As these routines
perform the comparison using signed char variables all character codes
greater than 127 are interpreted as less than 0. These codes are used to
encode the iso8859 char sets.
The other text-like data types seem to work as expected as they use unsigned
chars in comparisons.
Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
Diffstat (limited to 'src/backend/utils/adt/varlena.c')
-rw-r--r-- | src/backend/utils/adt/varlena.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index a00528eff19..3f95681293c 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.4 1996/07/22 21:56:04 scrappy Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.5 1996/09/10 06:41:38 scrappy Exp $ * *------------------------------------------------------------------------- */ @@ -290,6 +290,9 @@ int32 text_lt(struct varlena *arg1, struct varlena *arg2) { int len; +#ifdef UNSIGNED_CHAR_TEXT + unsigned +#endif char *a1p, *a2p; if (arg1 == NULL || arg2 == NULL) @@ -318,6 +321,9 @@ int32 text_le(struct varlena *arg1, struct varlena *arg2) { int len; +#ifdef UNSIGNED_CHAR_TEXT + unsigned +#endif char *a1p, *a2p; if (arg1 == NULL || arg2 == NULL) |