From 92fd65832727162a003647b4c48344dc9567ce84 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 17 Jul 2015 16:27:41 +0300 Subject: MDEV-8475 stale .TMM file causes MyiSAM and Aria engine to stop serving the table Issue was two fold (both in MyISAM and Aria) - optimize and repair failed if there was an old .TMM file around. As optimized and repair are protected against multiple execution, I decided to change so that we just truncate the file if it exists. - I had missed to check for error condition if creation of the temporary index file failed. This caused the strange behaviour that it looked as if optimized would have worked once. --- mysql-test/r/myisam-optimize.result | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 mysql-test/r/myisam-optimize.result (limited to 'mysql-test/r/myisam-optimize.result') diff --git a/mysql-test/r/myisam-optimize.result b/mysql-test/r/myisam-optimize.result new file mode 100644 index 00000000000..9451046fe08 --- /dev/null +++ b/mysql-test/r/myisam-optimize.result @@ -0,0 +1,69 @@ +# +# MDEV-8475 stale .TMM file causes Aria engine to stop serving the table +# +create table t1 (pk int primary key, i int) engine=MyISAM; +insert into t1 values (1,1),(2,2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +DROP TABLE t1; +create table t1 (pk int primary key, i int) engine=aria; +insert into t1 values (1,1),(2,2); +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `pk` int(11) NOT NULL, + `i` int(11) DEFAULT NULL, + PRIMARY KEY (`pk`) +) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status Table is already up to date +DROP TABLE t1; -- cgit v1.2.1