12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
#include "myisamdef.h"
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16
#include "myisam_priv.h"
17
#include <drizzled/util/test.h>
19
using namespace drizzled;
19
22
** Find current row with read on position or read on key
28
int mi_rsame(MI_INFO *info, uchar *record, int inx)
31
int mi_rsame(MI_INFO *info, unsigned char *record, int inx)
30
33
if (inx != -1 && ! mi_is_key_active(info->s->state.key_map, inx))
32
return(my_errno=HA_ERR_WRONG_INDEX);
35
return(errno=HA_ERR_WRONG_INDEX);
34
37
if (info->lastpos == HA_OFFSET_ERROR || info->update & HA_STATE_DELETED)
36
return(my_errno=HA_ERR_KEY_NOT_FOUND); /* No current record */
39
return(errno=HA_ERR_KEY_NOT_FOUND); /* No current record */
38
41
info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
40
43
/* Read row from data file */
41
44
if (fast_mi_readinfo(info))
47
50
info->lastkey_length=_mi_make_key(info,(uint) inx,info->lastkey,record,
49
if (info->s->concurrent_insert)
50
rw_rdlock(&info->s->key_root_lock[inx]);
51
VOID(_mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
53
info->s->state.key_root[inx]));
54
if (info->s->concurrent_insert)
55
rw_unlock(&info->s->key_root_lock[inx]);
52
_mi_search(info,info->s->keyinfo+inx,info->lastkey, USE_WHOLE_KEY,
54
info->s->state.key_root[inx]);
58
57
if (!(*info->read_record)(info,info->lastpos,record))
60
if (my_errno == HA_ERR_RECORD_DELETED)
61
my_errno=HA_ERR_KEY_NOT_FOUND;
59
if (errno == HA_ERR_RECORD_DELETED)
60
errno=HA_ERR_KEY_NOT_FOUND;