From: Date: July 19 2007 10:51am Subject: bk commit into 5.0 tree (svoj:1.2529) BUG#26325 List-Archive: http://lists.mysql.com/commits/31160 X-Bug: 26325 Message-Id: <20070719085135.D4D4B41CEC6@june.myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 5.0 repository of svoj. When svoj 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-07-19 13:51:31+05:00, svoj@stripped +3 -0 BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK TABLE CHECK/REPAIR TABLE reports "File not found" error when issued against temporary table. Fixed by disabling a brunch of code (in case it gets temporary table) that is responsible for updating frm version as it is not needed for temporary tables. mysql-test/r/check.result@stripped, 2007-07-19 13:51:29+05:00, svoj@stripped +8 -0 A test case for BUG#26325. mysql-test/t/check.test@stripped, 2007-07-19 13:51:29+05:00, svoj@stripped +9 -0 A test case for BUG#26325. sql/handler.cc@stripped, 2007-07-19 13:51:29+05:00, svoj@stripped +7 -1 No need to update frm version in case table was created or checked by server with the same version. This also ensures that we do not update frm version for temporary tables as this code doesn't support temporary tables. diff -Nrup a/mysql-test/r/check.result b/mysql-test/r/check.result --- a/mysql-test/r/check.result 2006-10-03 19:02:39 +05:00 +++ b/mysql-test/r/check.result 2007-07-19 13:51:29 +05:00 @@ -14,3 +14,11 @@ test.v1 check status OK test.t2 check status OK drop view v1; drop table t1, t2; +CREATE TEMPORARY TABLE t1(a INT); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +DROP TABLE t1; diff -Nrup a/mysql-test/t/check.test b/mysql-test/t/check.test --- a/mysql-test/t/check.test 2005-07-28 19:09:48 +05:00 +++ b/mysql-test/t/check.test 2007-07-19 13:51:29 +05:00 @@ -36,3 +36,12 @@ Create view v1 as Select * from t1; Check Table v1,t2; drop view v1; drop table t1, t2; + +# +# BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK +# TABLE +# +CREATE TEMPORARY TABLE t1(a INT); +CHECK TABLE t1; +REPAIR TABLE t1; +DROP TABLE t1; diff -Nrup a/sql/handler.cc b/sql/handler.cc --- a/sql/handler.cc 2007-06-20 13:46:11 +05:00 +++ b/sql/handler.cc 2007-07-19 13:51:29 +05:00 @@ -1997,7 +1997,13 @@ static bool update_frm_version(TABLE *ta int result= 1; DBUG_ENTER("update_frm_version"); - if (table->s->mysql_version != MYSQL_VERSION_ID) + /* + No need to update frm version in case table was created or checked + by server with the same version. This also ensures that we do not + update frm version for temporary tables as this code doesn't support + temporary tables. + */ + if (table->s->mysql_version == MYSQL_VERSION_ID) DBUG_RETURN(0); strxnmov(path, sizeof(path)-1, mysql_data_home, "/", table->s->db, "/",