From: Date: April 18 2007 12:28am Subject: bk commit into 5.0 tree (dkatz:1.2459) BUG#25761 List-Archive: http://lists.mysql.com/commits/24728 X-Bug: 25761 Message-Id: <20070417222817.70C7C2B4FB8@damien-katzs-computer.local> Below is the list of changes that have just been committed into a local 5.0 repository of dkatz. When dkatz 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-04-17 18:28:11-04:00, dkatz@stripped +1 -0 Bug #25761 Table is partially created when disk is full, causing database corruption Potential fix, exploring ways to test it. sql/sql_table.cc@stripped, 2007-04-17 18:28:08-04:00, dkatz@stripped +6 -2 Upon .frm file copy error. added code to delete the partially created file if it didn't exist already. # 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: dkatz # Host: damien-katzs-computer.local # Root: /Users/dkatz/50c_tablebug --- 1.340/sql/sql_table.cc 2007-04-10 06:02:02 -04:00 +++ 1.341/sql/sql_table.cc 2007-04-17 18:28:08 -04:00 @@ -2823,9 +2823,13 @@ bool mysql_create_like_table(THD* thd, T if (my_copy(src_path, dst_path, MYF(MY_DONT_OVERWRITE_FILE))) { if (my_errno == ENOENT) - my_error(ER_BAD_DB_ERROR,MYF(0),db); + my_error(ER_BAD_DB_ERROR, MYF(0), db); else - my_error(ER_CANT_CREATE_FILE,MYF(0),dst_path,my_errno); + { + if (my_errno != EEXIST) + my_delete(dst_path, MYF(0)); // possibly a partially created file. delete it. + my_error(ER_CANT_CREATE_FILE,MYF(0), dst_path, my_errno); + } goto err; }