summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2001-03-12 15:00:13 +0100
committerunknown <serg@serg.mysql.com>2001-03-12 15:00:13 +0100
commit3368b1004537c418428e6ac4cf8695d97e789e49 (patch)
treebc562162fe2f86da098025b6b20dea9ba6f8e6c3 /myisammrg
parent125c51eede71dc4962bb924bda78420c6bd7098f (diff)
downloadmariadb-git-3368b1004537c418428e6ac4cf8695d97e789e49.tar.gz
myisammrg/myrg_rnext.c bug with incomlete queue fixed
myisammrg/myrg_rprev.c bug with incomlete queue fixed myisammrg/myrg_rnext.c: bug with incomlete queue fixed myisammrg/myrg_rprev.c: bug with incomlete queue fixed
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_rnext.c7
-rw-r--r--myisammrg/myrg_rprev.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/myisammrg/myrg_rnext.c b/myisammrg/myrg_rnext.c
index 71a4d081e8a..104a94a6f91 100644
--- a/myisammrg/myrg_rnext.c
+++ b/myisammrg/myrg_rnext.c
@@ -29,11 +29,7 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
if ((err=mi_rnext(info->current_table->table,NULL,inx)))
{
if (err == HA_ERR_END_OF_FILE)
- {
queue_remove(&(info->by_key),0);
- if (!info->by_key.elements)
- return HA_ERR_END_OF_FILE;
- }
else
return err;
}
@@ -48,6 +44,9 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
if ((err=_myrg_finish_scan(info, inx, HA_READ_KEY_OR_NEXT)))
return err;
+ if (!info->by_key.elements)
+ return HA_ERR_END_OF_FILE;
+
/* 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);
diff --git a/myisammrg/myrg_rprev.c b/myisammrg/myrg_rprev.c
index 8d7a810696f..c63c73b4200 100644
--- a/myisammrg/myrg_rprev.c
+++ b/myisammrg/myrg_rprev.c
@@ -29,11 +29,7 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
if ((err=mi_rprev(info->current_table->table,NULL,inx)))
{
if (err == HA_ERR_END_OF_FILE)
- {
queue_remove(&(info->by_key),0);
- if (!info->by_key.elements)
- return HA_ERR_END_OF_FILE;
- }
else
return err;
}
@@ -48,6 +44,9 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
if ((err=_myrg_finish_scan(info, inx, HA_READ_KEY_OR_PREV)))
return err;
+ if (!info->by_key.elements)
+ return HA_ERR_END_OF_FILE;
+
/* 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);