Commit f7d4410b authored by serg@serg.mylan's avatar serg@serg.mylan

checking 2nd level of FT index destroyed info->lastkey and CHECK TABLE...

checking 2nd level of FT index destroyed info->lastkey and CHECK TABLE erroneously treated table as corrupted
bug#2190
parent 7bb74b65
...@@ -551,7 +551,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ...@@ -551,7 +551,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
ha_checksum *key_checksum, uint level) ha_checksum *key_checksum, uint level)
{ {
int flag; int flag;
uint used_length,comp_flag,nod_flag,key_length,not_used; uint used_length,comp_flag,nod_flag,key_length=0,not_used;
uchar key[MI_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos; uchar key[MI_MAX_POSSIBLE_KEY_BUFF],*temp_buff,*keypos,*old_keypos,*endpos;
my_off_t next_page,record; my_off_t next_page,record;
char llbuff[22]; char llbuff[22];
...@@ -586,6 +586,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ...@@ -586,6 +586,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
} }
for ( ;; ) for ( ;; )
{ {
memcpy((char*) info->lastkey,(char*) key,key_length);
info->lastkey_length=key_length;
if (nod_flag) if (nod_flag)
{ {
next_page=_mi_kpos(nod_flag,keypos); next_page=_mi_kpos(nod_flag,keypos);
...@@ -629,8 +631,6 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ...@@ -629,8 +631,6 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
} }
(*key_checksum)+= mi_byte_checksum((byte*) key, (*key_checksum)+= mi_byte_checksum((byte*) key,
key_length- info->s->rec_reflength); key_length- info->s->rec_reflength);
memcpy((char*) info->lastkey,(char*) key,key_length);
info->lastkey_length=key_length;
record= _mi_dpos(info,0,key+key_length); record= _mi_dpos(info,0,key+key_length);
if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */ if (keyinfo->flag & HA_FULLTEXT) /* special handling for ft2 */
{ {
...@@ -658,7 +658,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ...@@ -658,7 +658,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
DBUG_PRINT("test",("page: %s record: %s filelength: %s", DBUG_PRINT("test",("page: %s record: %s filelength: %s",
llstr(page,llbuff),llstr(record,llbuff2), llstr(page,llbuff),llstr(record,llbuff2),
llstr(info->state->data_file_length,llbuff3))); llstr(info->state->data_file_length,llbuff3)));
DBUG_DUMP("key",(byte*) info->lastkey,key_length); DBUG_DUMP("key",(byte*) key,key_length);
DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos)); DBUG_DUMP("new_in_page",(char*) old_keypos,(uint) (keypos-old_keypos));
goto err; goto err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment