17 #include "myisamdef.h"
31 DBUG_ENTER(
"mi_rsame");
33 if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx))
35 DBUG_RETURN(my_errno=HA_ERR_WRONG_INDEX);
37 if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED)
39 DBUG_RETURN(my_errno=HA_ERR_KEY_NOT_FOUND);
41 info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
44 if (fast_mi_readinfo(info))
45 DBUG_RETURN(my_errno);
50 info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record,
52 if (info->s->concurrent_insert)
54 (void) _mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
56 info->s->state.key_root[inx]);
57 if (info->s->concurrent_insert)
61 if (!(*info->read_record)(info,info->lastpos,record))
63 if (my_errno == HA_ERR_RECORD_DELETED)
64 my_errno=HA_ERR_KEY_NOT_FOUND;
65 DBUG_RETURN(my_errno);