From b21997851493d2da85a34e8de669f55ae60a12f5 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Tue, 26 Aug 2008 18:48:50 +0500 Subject: Fix for bug #37310: 'on update CURRENT_TIMESTAMP' option crashes the table Problem: data consistency check (maximum record length) for a correct MyISAM table with CHECKSUM=1 and ROW_FORMAT=DYNAMIC option may fail due to wrong inner MyISAM parameter. In result we may have the table marked as 'corrupted'. Fix: properly set MyISAM maximum record length parameter. myisam/mi_create.c: Fix for bug #37310: 'on update CURRENT_TIMESTAMP' option crashes the table Use HA_OPTION_PACK_RECORD instead of HA_PACK_RECORD (typo?) calculating packed record length. --- mysql-test/t/myisam.test | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'mysql-test/t/myisam.test') diff --git a/mysql-test/t/myisam.test b/mysql-test/t/myisam.test index 90d4fc01afb..254b0378aa8 100644 --- a/mysql-test/t/myisam.test +++ b/mysql-test/t/myisam.test @@ -1210,4 +1210,19 @@ SELECT * FROM t1; DROP TABLE t1, t2; + +# +# Bug#37310: 'on update CURRENT_TIMESTAMP' option crashes the table +# +CREATE TABLE t1 (a INT) ENGINE=MyISAM CHECKSUM=1 ROW_FORMAT=DYNAMIC; +INSERT INTO t1 VALUES (0); +UPDATE t1 SET a=1; +SELECT a FROM t1; +CHECK TABLE t1; +INSERT INTO t1 VALUES (0), (5), (4), (2); +UPDATE t1 SET a=2; +SELECT a FROM t1; +CHECK TABLE t1; +DROP TABLE t1; + --echo End of 5.0 tests -- cgit v1.2.1