From: Jon Olav Hauglid Date: September 23 2010 9:13am Subject: bzr push into mysql-5.5-runtime branch (jon.hauglid:3141 to 3142) Bug#56422 List-Archive: http://lists.mysql.com/commits/118915 X-Bug: 56422 Message-Id: <201009230916.o8MHPBTs007190@acsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6857609011202651490==" --===============6857609011202651490== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 3142 Jon Olav Hauglid 2010-09-23 Followup to Bug #56422 CHECK TABLE run when the table is locked reports corruption along with timeout This patch updates the result file for the parts.partition_special_innodb test case which was, by mistake, not updated in the original patch. modified: mysql-test/suite/parts/r/partition_special_innodb.result 3141 Jon Olav Hauglid 2010-09-22 Bug #56494 Segfault in upgrade_shared_lock_to_exclusive() for REPAIR of merge table Bug #56422 CHECK TABLE run when the table is locked reports corruption along with timeout The crash happened if a table maintenance statement (ANALYZE TABLE, REPAIR TABLE, etc.) was executed on a MERGE table and opening and locking a child table failed. This could for example happen if a child table did not exist or if a lock timeout happened while waiting for a conflicting metadata lock to disappear. Since opening and locking the MERGE table and its children failed, the tables would be closed and the metadata locks released. However, TABLE_LIST::table for the MERGE table would still be set, with its value invalid since the tables had been closed. This caused the table maintenance statement to try to continue and upgrade the metadata lock on the MERGE table. But since the lock already had been released, this caused a segfault. This patch fixes the problem by setting TABLE_LIST::table to NULL if open_and_lock_tables() fails. This prevents maintenance statements from continuing and trying to upgrade the metadata lock. The patch includes a 5.5 version of the fix for Bug #46339 crash on REPAIR TABLE merge table USE_FRM. This bug caused REPAIR TABLE ... USE_FRM to give an assert when used on merge tables. The patch also enables the CHECK TABLE statement for log tables. Before, CHECK TABLE for log tables gave ER_CANT_LOCK_LOG_TABLE, yet still counted the statement as successfully executed. With the changes to table maintenance statement error handling in this patch, CHECK TABLE would no longer be considered as successful in this case. This would have caused upgrade scripts to mistakenly think that the general and slow logs are corrupted and have to be repaired. Enabling CHECK TABLES for log tables prevents this from happening. Finally, the patch changes the error message from "Corrupt" to "Operation failed" for a number of issues not related to table corruption. For example "Lock wait timeout exceeded" and "Deadlock found trying to get lock". Test cases added to merge.test and check.test. modified: mysql-test/r/check.result mysql-test/r/log_tables_upgrade.result mysql-test/r/merge.result mysql-test/r/myisampack.result mysql-test/r/mysql_upgrade.result mysql-test/r/mysql_upgrade_ssl.result mysql-test/t/check.test mysql-test/t/merge.test sql/sql_admin.cc sql/sql_parse.cc === modified file 'mysql-test/suite/parts/r/partition_special_innodb.result' --- a/mysql-test/suite/parts/r/partition_special_innodb.result 2010-08-13 07:50:25 +0000 +++ b/mysql-test/suite/parts/r/partition_special_innodb.result 2010-09-23 09:13:21 +0000 @@ -242,7 +242,7 @@ ERROR HY000: Lock wait timeout exceeded; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check Error Lock wait timeout exceeded; try restarting transaction -test.t1 check error Corrupt +test.t1 check status Operation failed UNLOCK TABLES; DROP TABLE t1; CREATE TABLE t2 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT ) --===============6857609011202651490== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/jon.hauglid@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: jon.hauglid@stripped # target_branch: file:///export/home/x/mysql-5.5-runtime-test/ # testament_sha1: fc7f2d9803dce0b4895aee0b4f97396ecb4fd538 # timestamp: 2010-09-23 11:13:51 +0200 # source_branch: file:///export/home/x/mysql-5.5-bugfixing/ # base_revision_id: jon.hauglid@stripped\ # mpy5ty4vmw0k5j19 # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWS2aZ0gAAYR/gAAwCABYZ//3 e1yEAL////BQBA17223nt67r3nrz09bwlITTImmKb1U/aApqbIn6o9Q9Gp6nqYZEwJSTQaMU8U00 Gk0zU0AaAAGhoJRNBT9JTwm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