1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Davi Arnaut
2010-07-26 12:54:20 -03:00
parent 3994aa8548
commit ed434ce045
5 changed files with 95 additions and 12 deletions

View File

@ -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;