From: Date: March 9 2007 12:51pm Subject: bk commit into 4.1 tree (istruewing:1.2608) BUG#25289 List-Archive: http://lists.mysql.com/commits/21589 X-Bug: 25289 Message-Id: Below is the list of changes that have just been committed into a local 4.1 repository of istruewing. When istruewing does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-03-09 12:51:32+01:00, istruewing@stripped +1 -0 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" In difficult repair situations the server could crash. Under some circumstances the server retries a repair with more elaborate options. But it did not check if the first repair failed so badly that a second attempt must not be tried. This could happen when a new data file has been created but it was not possible to open it. In this case the repair leaves behind a table with closed data file. This must not be used for another repair attempt. We do now detect the closed data file and do not try another repair attempt in this situation. No test case. The required table corruption can not be repeated easily. There is a test program attached to bug 25433. sql/ha_myisam.cc@stripped, 2007-03-09 12:51:30+01:00, istruewing@stripped +13 -1 Bug#25289 - repair table causes "my_seek.c:56: my_seek: Assertion `fd != -1' failed" Added code to detect a closed data file after a repair attempt. We do not try another repair then any more. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: istruewing # Host: chilla.local # Root: /home/mydev/mysql-4.1-bug25289 --- 1.164/sql/ha_myisam.cc 2007-03-09 12:51:36 +01:00 +++ 1.165/sql/ha_myisam.cc 2007-03-09 12:51:36 +01:00 @@ -790,7 +790,11 @@ int ha_myisam::repair(THD* thd, HA_CHECK MI_CHECK param; ha_rows start_records; - if (!file) return HA_ADMIN_INTERNAL_ERROR; + if (!file) + return HA_ADMIN_INTERNAL_ERROR; + + /* Table must be correctly opened for repair. (Bug #25289) */ + DBUG_ASSERT(file->dfile >= 0); myisamchk_init(¶m); param.thd = thd; @@ -803,6 +807,14 @@ int ha_myisam::repair(THD* thd, HA_CHECK while ((error=repair(thd,param,0)) && param.retry_repair) { param.retry_repair=0; + if (file->dfile == -1) + { + /* + Repair failed and new data file could not be reopened. + Cannot continue. Table is no longer correctly open. (Bug #25289) + */ + break; + } if (test_all_bits(param.testflag, (uint) (T_RETRY_WITHOUT_QUICK | T_QUICK))) {