summaryrefslogtreecommitdiff
path: root/src/backend/access/hash/hashfunc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-12-22 22:50:00 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-12-22 22:50:00 +0000
commit656beff59033ccc5261a615802e1a85da68e8fad (patch)
tree70bb7da9a720ed4a83fccc144f21c45c63ca0752 /src/backend/access/hash/hashfunc.c
parent7b53b45a643f466d2fe039dc0865a70d0f1d736e (diff)
Adjust string comparison so that only bitwise-equal strings are considered
equal: if strcoll claims two strings are equal, check it with strcmp, and sort according to strcmp if not identical. This fixes inconsistent behavior under glibc's hu_HU locale, and probably under some other locales as well. Also, take advantage of the now-well-defined behavior to speed up texteq, textne, bpchareq, bpcharne: they may as well just do a bitwise comparison and not bother with strcoll at all. NOTE: affected databases may need to REINDEX indexes on text columns to be sure they are self-consistent.
Diffstat (limited to 'src/backend/access/hash/hashfunc.c')
-rw-r--r--src/backend/access/hash/hashfunc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/backend/access/hash/hashfunc.c b/src/backend/access/hash/hashfunc.c
index 2ffca5efe6a..6cf9eb6eee2 100644
--- a/src/backend/access/hash/hashfunc.c
+++ b/src/backend/access/hash/hashfunc.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/hash/hashfunc.c,v 1.45 2005/10/15 02:49:08 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/hash/hashfunc.c,v 1.46 2005/12/22 22:50:00 tgl Exp $
*
* NOTES
* These functions are stored in pg_amproc. For each operator class
@@ -138,9 +138,9 @@ hashtext(PG_FUNCTION_ARGS)
Datum result;
/*
- * Note: this is currently identical in behavior to hashvarlena, but it
- * seems likely that we may need to do something different in non-C
- * locales. (See also hashbpchar, if so.)
+ * Note: this is currently identical in behavior to hashvarlena, but
+ * keep it as a separate function in case we someday want to do something
+ * different in non-C locales. (See also hashbpchar, if so.)
*/
result = hash_any((unsigned char *) VARDATA(key),
VARSIZE(key) - VARHDRSZ);