diff options
author | Davi Arnaut <davi.arnaut@oracle.com> | 2010-07-26 12:54:20 -0300 |
---|---|---|
committer | Davi Arnaut <davi.arnaut@oracle.com> | 2010-07-26 12:54:20 -0300 |
commit | e4cbcaf942796e5ba1f865485ea56c3903cf2fb8 (patch) | |
tree | 7351d5d892130fe6f95d96337a08097268d2e199 /mysql-test/r/archive.result | |
parent | 0a8021610d08718c614c3cd62332a6b4a8c2cabc (diff) | |
download | mariadb-git-e4cbcaf942796e5ba1f865485ea56c3903cf2fb8.tar.gz |
Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE
The problem was that the optimize method of the ARCHIVE storage
engine was not preserving the FRM embedded in the ARZ file when
rewriting the ARZ file for optimization. The ARCHIVE engine stores
the FRM in the ARZ file so it can be transferred from machine to
machine without also copying the FRM -- the engine restores the
embedded FRM during discovery.
The solution is to copy over the FRM when rewriting the ARZ file.
In addition, some initial error checking is performed to ensure
garbage is not copied over.
mysql-test/t/archive.test:
Add test case for Bug#45377.
storage/archive/azio.c:
Add error checking to ensure that the I/O operations are
successful.
storage/archive/ha_archive.cc:
Copy over the embedded FRM.
Diffstat (limited to 'mysql-test/r/archive.result')
-rw-r--r-- | mysql-test/r/archive.result | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 685e1e5ba4b..028c8b32f87 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12775,3 +12775,29 @@ a 1 2 DROP TABLE t1; +# +# Bug#45377: ARCHIVE tables aren't discoverable after OPTIMIZE +# +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 (a int) ENGINE=ARCHIVE; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES (1); +OPTIMIZE TABLE t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +FLUSH TABLES; +INSERT INTO t1 VALUES (2); +SELECT * FROM t1 ORDER BY a; +a +1 +2 +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +DROP TABLE t1; |