summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <svoj@april.(none)>2006-04-27 12:51:33 +0500
committerunknown <svoj@april.(none)>2006-04-27 12:51:33 +0500
commitaa4ad136943136ab5304ba7298aece8ef53e406c (patch)
tree37a6034b17c3e413290490d4f313a1652ea45689 /myisam
parent96f58e1b268fdcf0c495efacd05268f1ad6f23ad (diff)
downloadmariadb-git-aa4ad136943136ab5304ba7298aece8ef53e406c.tar.gz
BUG#17810 - REPAIR says ok, CHECK says broken (repeatable)
Write operations on tables created in 4.x with index on variable length column results in index crash. Even REPAIR TABLE wasn't able to fix broken index. Problem was that packed key length size wasn't restored correctly. In 5.0 packed key length size is either 1 or 2. In 4.x this length is always 2, but is saved as 0. This fix ensures that key length size is restored correctly for 4.x tables. myisam/mi_key.c: Ensure that pack_length is either 1 or 2 (compatibility with 4.x).
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index 5dcc99d41b4..717a5dbd56e 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -127,7 +127,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
}
if (keyseg->flag & HA_VAR_LENGTH_PART)
{
- uint pack_length= keyseg->bit_start;
+ uint pack_length= (keyseg->bit_start == 1 ? 1 : 2);
uint tmp_length= (pack_length == 1 ? (uint) *(uchar*) pos :
uint2korr(pos));
pos+= pack_length; /* Skip VARCHAR length */