diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2013-07-29 18:08:49 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2013-07-29 18:08:49 +0400 |
commit | 0f985c6407f331d7be9fd98af2104ca14ec6adf8 (patch) | |
tree | ba062c6c851e9c5da5f1e6d1ba92ddf4efb70a86 /mysql-test/suite/archive | |
parent | 5f8effe1db11c55c17df96b14993a73fe1f045ec (diff) | |
download | mariadb-git-0f985c6407f331d7be9fd98af2104ca14ec6adf8.tar.gz |
MDEV-4786 - merge 10.0-monty - 10.0
Fixed archive.archive failure.
Applied remnants of two revisions, which were partially merged.
Rev. 3225.1.1 (5.0 compatibility):
BUG#11756687 - 48633: ARCHIVE TABLES ARE NOT UPGRADEABLE
Archive table created by 5.0 were not accessible.
This patch adds various fixes so that 5.0 archive tables
are readable and writable. Though it is strongly recommended
to avoid binary upgrade of archive tables whenever it is
possible.
Rev. 3710 (due to valgrind warnings):
Bug#13907676: HA_ARCHIVE::INFO
In WL#4305 the refactoring of the archive writer,
it could flush the writer when it was not yet open.
This was due to if bulk insert was used but no
rows was actually inserted (write_row was never called),
the writer was marked dirty even if it was not open.
Fix was to only mark it as dirty if it was opened.
mysql-test/std_data/bug48633.ARM:
A test case for BUG#11756687: archive table created by 5.0.95.
mysql-test/std_data/bug48633.ARZ:
A test case for BUG#11756687: archive table created by 5.0.95.
mysql-test/std_data/bug48633.frm:
A test case for BUG#11756687: archive table created by 5.0.95.
mysql-test/suite/archive/archive.result:
Modified a test case for BUG#47012 according to fix for
BUG#11756687.
Added a test case for BUG#11756687.
mysql-test/suite/archive/archive.test:
Modified a test case for BUG#47012 according to fix for
BUG#11756687.
Added a test case for BUG#11756687.
No need to remove .ARM files anymore: DROP TABLE will take
care of them.
storage/archive/azio.c:
Do not write AZIO (v.3) header to GZIO file (v.1).
Added initialization of various azio_stream members
to read_header() so it can proceed with v.1 format.
Update data start position only when reading first
GZIO header. That is only on azopen(), but never on
azread().
storage/archive/ha_archive.cc:
Removed guardians that were rejecting to open v.1 archive
tables.
Reload .frm when repairing v.1 tables - they didn't have
storage for .frm.
Do not flush write stream when it is not open.
Let DROP TABLE remove 5.0 .ARM files.
Diffstat (limited to 'mysql-test/suite/archive')
-rw-r--r-- | mysql-test/suite/archive/archive.result | 59 | ||||
-rw-r--r-- | mysql-test/suite/archive/archive.test | 38 |
2 files changed, 88 insertions, 9 deletions
diff --git a/mysql-test/suite/archive/archive.result b/mysql-test/suite/archive/archive.result index b187c216120..b92018fba8b 100644 --- a/mysql-test/suite/archive/archive.result +++ b/mysql-test/suite/archive/archive.result @@ -12729,7 +12729,6 @@ id id name name 1 1 a b 2 2 a b DROP TABLE t1,t2; -flush tables; SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -12741,7 +12740,7 @@ col1 col2 INSERT INTO t1 (col1, col2) VALUES (1, "value"); REPAIR TABLE t1; Table Op Msg_type Msg_text -test.t1 repair error Corrupt +test.t1 repair status OK DROP TABLE t1; # # Ensure that TRUNCATE fails for non-empty archive tables. @@ -12787,6 +12786,62 @@ a b c d e f DROP TABLE t1; SET sort_buffer_size=DEFAULT; # +# BUG#11756687 - 48633: ARCHIVE TABLES ARE NOT UPGRADEABLE +# +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) DEFAULT NULL, + `b` text, + `c` varchar(255) DEFAULT NULL, + `d` blob, + `e` blob +) ENGINE=ARCHIVE DEFAULT CHARSET=latin1 +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +FLUSH TABLE t1; +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check error Table upgrade required. Please do "REPAIR TABLE `t1`" or dump/reload to fix it! +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +INSERT INTO t1 VALUES(3, 'text', 'varchar', 'blob1', 'blob2'); +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +3 text varchar blob1 blob2 +FLUSH TABLE t1; +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +3 text varchar blob1 blob2 +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +SELECT * FROM t1; +a b c d e +1 text varchar blob1 blob2 +2 text varchar blob1 blob2 +3 text varchar blob1 blob2 +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +DROP TABLE t1; +# # BUG#11758979 - 51252: ARCHIVE TABLES STILL FAIL UNDER STRESS # TESTS: CRASH, CORRUPTION, 4G MEMOR # (to be executed with valgrind) diff --git a/mysql-test/suite/archive/archive.test b/mysql-test/suite/archive/archive.test index 5d96aa256fb..81a73683541 100644 --- a/mysql-test/suite/archive/archive.test +++ b/mysql-test/suite/archive/archive.test @@ -12,6 +12,7 @@ DROP TABLE if exists t1,t2,t3,t4,t5,t6; --enable_warnings SET storage_engine=ARCHIVE; +let $MYSQLD_DATADIR= `SELECT @@datadir`; CREATE TABLE t1 ( Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL, @@ -1643,12 +1644,6 @@ DROP TABLE t1,t2; # # BUG#47012 archive tables are not upgradeable, and server crashes on any access # -let $MYSQLD_DATADIR= `SELECT @@datadir`; - -# Remove files to handle possible restart of test -flush tables; -remove_files_wildcard $MYSQLD_DATADIR/test t1.*; - copy_file std_data/bug47012.frm $MYSQLD_DATADIR/test/t1.frm; copy_file std_data/bug47012.ARZ $MYSQLD_DATADIR/test/t1.ARZ; copy_file std_data/bug47012.ARM $MYSQLD_DATADIR/test/t1.ARM; @@ -1661,7 +1656,6 @@ INSERT INTO t1 (col1, col2) VALUES (1, "value"); REPAIR TABLE t1; DROP TABLE t1; -remove_file $MYSQLD_DATADIR/test/t1.ARM; --echo # --echo # Ensure that TRUNCATE fails for non-empty archive tables. @@ -1712,6 +1706,36 @@ DROP TABLE t1; SET sort_buffer_size=DEFAULT; --echo # +--echo # BUG#11756687 - 48633: ARCHIVE TABLES ARE NOT UPGRADEABLE +--echo # +copy_file std_data/bug48633.frm $MYSQLD_DATADIR/test/t1.frm; +copy_file std_data/bug48633.ARZ $MYSQLD_DATADIR/test/t1.ARZ; +copy_file std_data/bug48633.ARM $MYSQLD_DATADIR/test/t1.ARM; +SHOW CREATE TABLE t1; +# Test first table scan +SELECT * FROM t1; +# Test second table scan +SELECT * FROM t1; +# Test table close +FLUSH TABLE t1; +SELECT * FROM t1; +# Test check +CHECK TABLE t1; +SELECT * FROM t1; +# Test insert +INSERT INTO t1 VALUES(3, 'text', 'varchar', 'blob1', 'blob2'); +SELECT * FROM t1; +# Test table close after insert +FLUSH TABLE t1; +SELECT * FROM t1; +# Test repair +REPAIR TABLE t1; +SELECT * FROM t1; +# Test check table after upgrade +CHECK TABLE t1; +DROP TABLE t1; + +--echo # --echo # BUG#11758979 - 51252: ARCHIVE TABLES STILL FAIL UNDER STRESS --echo # TESTS: CRASH, CORRUPTION, 4G MEMOR --echo # (to be executed with valgrind) |