summaryrefslogtreecommitdiff
path: root/storage/myisam/mi_statrec.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam/mi_statrec.c')
-rw-r--r--storage/myisam/mi_statrec.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/storage/myisam/mi_statrec.c b/storage/myisam/mi_statrec.c
index 7d595916d78..f83afa3c886 100644
--- a/storage/myisam/mi_statrec.c
+++ b/storage/myisam/mi_statrec.c
@@ -298,8 +298,17 @@ int _mi_read_rnd_static_record(MI_INFO *info, uchar *buf,
info->update|= HA_STATE_AKTIV | HA_STATE_KEY_CHANGED;
DBUG_RETURN(0);
}
- /* my_errno should be set if rec_cache.error == -1 */
+ /* error is TRUE. my_errno should be set if rec_cache.error == -1 */
if (info->rec_cache.error != -1 || my_errno == 0)
- my_errno=HA_ERR_WRONG_IN_RECORD;
+ {
+ /*
+ If we could not get a full record, we either have a broken record,
+ or are at end of file.
+ */
+ if (info->rec_cache.error == 0)
+ my_errno= HA_ERR_END_OF_FILE;
+ else
+ my_errno= HA_ERR_WRONG_IN_RECORD;
+ }
DBUG_RETURN(my_errno); /* Something wrong (EOF?) */
}