diff options
author | unknown <istruewing@chilla.local> | 2007-03-15 13:02:18 +0100 |
---|---|---|
committer | unknown <istruewing@chilla.local> | 2007-03-15 13:02:18 +0100 |
commit | c7ce63fb0ba339ffa15a36515831660225a49e53 (patch) | |
tree | 2a3a49fce5b987028b39d3e2aad9b947f62215fb /sql/ha_myisam.cc | |
parent | 2f863451b5c5fe848d26f5f87ae27f13415805b3 (diff) | |
parent | 3c89dd7966e727d7ded902b195d8f133de94b565 (diff) | |
download | mariadb-git-c7ce63fb0ba339ffa15a36515831660225a49e53.tar.gz |
Merge chilla.local:/home/mydev/mysql-4.1-bug25289
into chilla.local:/home/mydev/mysql-5.0-bug25289
sql/ha_myisam.cc:
Bug#25289 - repair table causes "my_seek.c:56:
my_seek: Assertion `fd != -1' failed"
Manual merge from 4.1
Diffstat (limited to 'sql/ha_myisam.cc')
-rw-r--r-- | sql/ha_myisam.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 39f8894ae89..c9d0b83df00 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -941,6 +941,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK ¶m, bool optimize) ha_rows rows= file->state->records; DBUG_ENTER("ha_myisam::repair"); + /* + Normally this method is entered with a properly opened table. If the + repair fails, it can be repeated with more elaborate options. Under + special circumstances it can happen that a repair fails so that it + closed the data file and cannot re-open it. In this case file->dfile + is set to -1. We must not try another repair without an open data + file. (Bug #25289) + */ + if (file->dfile == -1) + { + sql_print_information("Retrying repair of: '%s' failed. " + "Please try REPAIR EXTENDED or myisamchk", + table->s->path); + DBUG_RETURN(HA_ADMIN_FAILED); + } + param.db_name= table->s->db; param.table_name= table->alias; param.tmpfile_createflag = O_RDWR | O_TRUNC; |