summaryrefslogtreecommitdiff
path: root/myisammrg
diff options
context:
space:
mode:
authorserg@sergbook.mysql.com <>2002-07-04 12:25:13 +0200
committerserg@sergbook.mysql.com <>2002-07-04 12:25:13 +0200
commit5fc90aa02dfb3e8d39675c7fe854926acb62a21e (patch)
tree636d4ee01a5844013a180612e8c8c5387ca5f3ad /myisammrg
parentc06cc02c5d3ac6124ead2790b0edcb628a6f5c89 (diff)
downloadmariadb-git-5fc90aa02dfb3e8d39675c7fe854926acb62a21e.tar.gz
do not crash on myrg_rprev/myrg_rnext if no current table
(as when previous myrg_rkey failed, e.g. found nothing)
Diffstat (limited to 'myisammrg')
-rw-r--r--myisammrg/myrg_rnext.c3
-rw-r--r--myisammrg/myrg_rprev.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/myisammrg/myrg_rnext.c b/myisammrg/myrg_rnext.c
index 5a3fbdfb299..703ca29632b 100644
--- a/myisammrg/myrg_rnext.c
+++ b/myisammrg/myrg_rnext.c
@@ -25,6 +25,9 @@ int myrg_rnext(MYRG_INFO *info, byte *buf, int inx)
int err;
MI_INFO *mi;
+ if (!info->current_table)
+ return (HA_ERR_KEY_NOT_FOUND);
+
/* at first, do rnext for the table found before */
if ((err=mi_rnext(info->current_table->table,NULL,inx)))
{
diff --git a/myisammrg/myrg_rprev.c b/myisammrg/myrg_rprev.c
index d8089e80498..8c43b40035a 100644
--- a/myisammrg/myrg_rprev.c
+++ b/myisammrg/myrg_rprev.c
@@ -25,6 +25,9 @@ int myrg_rprev(MYRG_INFO *info, byte *buf, int inx)
int err;
MI_INFO *mi;
+ if (!info->current_table)
+ return (HA_ERR_KEY_NOT_FOUND);
+
/* at first, do rprev for the table found before */
if ((err=mi_rprev(info->current_table->table,NULL,inx)))
{