diff options
-rw-r--r-- | myisammrg/myrg_def.h | 2 | ||||
-rw-r--r-- | myisammrg/myrg_queue.c | 12 | ||||
-rw-r--r-- | myisammrg/myrg_rfirst.c | 2 | ||||
-rw-r--r-- | myisammrg/myrg_rkey.c | 4 | ||||
-rw-r--r-- | myisammrg/myrg_rlast.c | 2 | ||||
-rw-r--r-- | myisammrg/myrg_rnext.c | 2 | ||||
-rw-r--r-- | myisammrg/myrg_rprev.c | 2 |
7 files changed, 18 insertions, 8 deletions
diff --git a/myisammrg/myrg_def.h b/myisammrg/myrg_def.h index d56cf4aa8d8..00e7950bccf 100644 --- a/myisammrg/myrg_def.h +++ b/myisammrg/myrg_def.h @@ -29,3 +29,5 @@ extern pthread_mutex_t THR_LOCK_open; #endif int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag); +int _myrg_mi_read_record(MI_INFO *info, byte *buf); + diff --git a/myisammrg/myrg_queue.c b/myisammrg/myrg_queue.c index b4f729fc2cf..5ec382feb91 100644 --- a/myisammrg/myrg_queue.c +++ b/myisammrg/myrg_queue.c @@ -14,8 +14,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Read record based on a key */ - #include "myrg_def.h" static int queue_key_cmp(void *keyseg, byte *a, byte *b) @@ -55,3 +53,13 @@ int _myrg_init_queue(MYRG_INFO *info,int inx,enum ha_rkey_function search_flag) } return error; } + +int _myrg_mi_read_record(MI_INFO *info, byte *buf) +{ + if (!(*info->read_record)(info,info->lastpos,buf)) + { + info->update|= HA_STATE_AKTIV; /* Record is read */ + return 0; + } + return my_errno; +} diff --git a/myisammrg/myrg_rfirst.c b/myisammrg/myrg_rfirst.c index 2ee9c015a84..9ba07686c47 100644 --- a/myisammrg/myrg_rfirst.c +++ b/myisammrg/myrg_rfirst.c @@ -45,5 +45,5 @@ int myrg_rfirst(MYRG_INFO *info, byte *buf, int inx) return HA_ERR_END_OF_FILE; mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return mi_rrnd(mi,buf,mi->lastpos); + return _myrg_mi_read_record(mi,buf); } diff --git a/myisammrg/myrg_rkey.c b/myisammrg/myrg_rkey.c index ba042352a51..fbfa7f24921 100644 --- a/myisammrg/myrg_rkey.c +++ b/myisammrg/myrg_rkey.c @@ -36,7 +36,7 @@ SerG */ -int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key, +int myrg_rkey(MYRG_INFO *info,byte *buf,int inx, const byte *key, uint key_len, enum ha_rkey_function search_flag) { byte *key_buff; @@ -83,5 +83,5 @@ int myrg_rkey(MYRG_INFO *info,byte *record,int inx, const byte *key, return HA_ERR_KEY_NOT_FOUND; mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return mi_rrnd(mi,record,mi->lastpos); + return _myrg_mi_read_record(mi,buf); } diff --git a/myisammrg/myrg_rlast.c b/myisammrg/myrg_rlast.c index e03a07c295a..96bb798bd4f 100644 --- a/myisammrg/myrg_rlast.c +++ b/myisammrg/myrg_rlast.c @@ -45,6 +45,6 @@ int myrg_rlast(MYRG_INFO *info, byte *buf, int inx) return HA_ERR_END_OF_FILE; mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return mi_rrnd(mi,buf,mi->lastpos); + return _myrg_mi_read_record(mi,buf); } diff --git a/myisammrg/myrg_rnext.c b/myisammrg/myrg_rnext.c index 6d657b5926c..0929c63fc1d 100644 --- a/myisammrg/myrg_rnext.c +++ b/myisammrg/myrg_rnext.c @@ -49,5 +49,5 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx) /* now, mymerge's read_next is as simple as one queue_top */ mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return mi_rrnd(mi,buf,mi->lastpos); + return _myrg_mi_read_record(mi,buf); } diff --git a/myisammrg/myrg_rprev.c b/myisammrg/myrg_rprev.c index c21ca06dacd..797993e903d 100644 --- a/myisammrg/myrg_rprev.c +++ b/myisammrg/myrg_rprev.c @@ -49,5 +49,5 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx) /* now, mymerge's read_prev is as simple as one queue_top */ mi=(info->current_table=(MYRG_TABLE *)queue_top(&(info->by_key)))->table; - return mi_rrnd(mi,buf,mi->lastpos); + return _myrg_mi_read_record(mi,buf); } |