diff options
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r-- | myisam/mi_check.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c index c61e94b6399..762eef15d68 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -551,7 +551,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, ha_checksum *key_checksum, uint level) { 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; my_off_t next_page,record; char llbuff[22]; @@ -586,6 +586,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, } for ( ;; ) { + memcpy((char*) info->lastkey,(char*) key,key_length); + info->lastkey_length=key_length; if (nod_flag) { next_page=_mi_kpos(nod_flag,keypos); @@ -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_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); 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, DBUG_PRINT("test",("page: %s record: %s filelength: %s", llstr(page,llbuff),llstr(record,llbuff2), 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)); goto err; } |