diff options
author | ramil@mysql.com <> | 2005-04-21 21:06:08 +0500 |
---|---|---|
committer | ramil@mysql.com <> | 2005-04-21 21:06:08 +0500 |
commit | 50ada0a01c9cd9a0d50f82db44de19d07fcee986 (patch) | |
tree | 777bb27eed163dcb09eee2a26f51ac36071fa8da /heap | |
parent | 564eb3dc98336663b6d414a347fe90dc6d2cb042 (diff) | |
download | mariadb-git-50ada0a01c9cd9a0d50f82db44de19d07fcee986.tar.gz |
A fix (Bug #9489: Problem with BIT_OR and MySQL 5.0.3)
Diffstat (limited to 'heap')
-rw-r--r-- | heap/hp_hash.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/heap/hp_hash.c b/heap/hp_hash.c index 3121ef71fb0..52a250bd7af 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -255,6 +255,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) if (*pos) /* Found null */ { nr^= (nr << 1) | 1; + /* Add key pack length (2) to key for VARCHAR segments */ + if (seg->type == HA_KEYTYPE_VARTEXT1) + key+= 2; continue; } pos++; @@ -390,6 +393,9 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) if (*pos) { nr^= (nr << 1) | 1; + /* Add key pack length (2) to key for VARCHAR segments */ + if (seg->type == HA_KEYTYPE_VARTEXT1) + key+= 2; continue; } pos++; @@ -584,7 +590,12 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) if (found_null != (int) *key++) return 1; if (found_null) + { + /* Add key pack length (2) to key for VARCHAR segments */ + if (seg->type == HA_KEYTYPE_VARTEXT1) + key+= 2; continue; + } } if (seg->type == HA_KEYTYPE_TEXT) { |