mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 18:41:56 +01:00
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).
This commit is contained in:
parent
96f58e1b26
commit
aa4ad13694
1 changed files with 1 additions and 1 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue