summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/june.mysql.com>2007-07-19 13:51:31 +0500
committerunknown <svoj@mysql.com/june.mysql.com>2007-07-19 13:51:31 +0500
commit2486c23ca6d10b17365f8502f8bba10fe0bc2edd (patch)
tree47881a202832a4bc8d38df3f311100ca29f9985b /sql/handler.cc
parent7dc853561ce05b84e3116dc2d089206b77bd342a (diff)
downloadmariadb-git-2486c23ca6d10b17365f8502f8bba10fe0bc2edd.tar.gz
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: A test case for BUG#26325. mysql-test/t/check.test: A test case for BUG#26325. sql/handler.cc: 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.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index f8aec72ec90..dcc9fde8b76 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -1997,7 +1997,13 @@ static bool update_frm_version(TABLE *table, bool needs_lock)
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, "/",