20 #include "myisamdef.h"
32 int mi_rrnd(
MI_INFO *info, uchar *
buf,
register my_off_t filepos)
34 my_bool skip_deleted_blocks;
35 DBUG_ENTER(
"mi_rrnd");
37 skip_deleted_blocks=0;
39 if (filepos == HA_OFFSET_ERROR)
41 skip_deleted_blocks=1;
42 if (info->lastpos == HA_OFFSET_ERROR)
43 filepos= info->s->pack.header_length;
45 filepos= info->nextpos;
48 if (info->once_flags & RRND_PRESERVE_LASTINX)
49 info->once_flags&= ~RRND_PRESERVE_LASTINX;
53 info->update&= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);
55 if (info->opt_flag & WRITE_CACHE_USED && flush_io_cache(&info->rec_cache))
56 DBUG_RETURN(my_errno);
58 DBUG_RETURN ((*info->s->read_rnd)(info,buf,filepos,skip_deleted_blocks));