summaryrefslogtreecommitdiff
path: root/mysql-test/suite/maria/maria-autozerofill.test
diff options
context:
space:
mode:
authorMichael Widenius <monty@askmonty.org>2012-04-04 00:16:38 +0300
committerMichael Widenius <monty@askmonty.org>2012-04-04 00:16:38 +0300
commitb04c4801b0529aebb39c8d9be95c123d2f3b7d46 (patch)
tree0a4f72935b5ac6816996172ae412b62327b4caf4 /mysql-test/suite/maria/maria-autozerofill.test
parent34ed8f33795b639d21817003236ce0f6c069481d (diff)
downloadmariadb-git-b04c4801b0529aebb39c8d9be95c123d2f3b7d46.tar.gz
Created suites for heap, archive and csv.
Moved test from main suite to the new suites. Move tests from maria/t and maria/r to maria mysql-test/mysql-test-run.pl: Added support for the new suites
Diffstat (limited to 'mysql-test/suite/maria/maria-autozerofill.test')
-rw-r--r--mysql-test/suite/maria/maria-autozerofill.test111
1 files changed, 111 insertions, 0 deletions
diff --git a/mysql-test/suite/maria/maria-autozerofill.test b/mysql-test/suite/maria/maria-autozerofill.test
new file mode 100644
index 00000000000..9bb2782105a
--- /dev/null
+++ b/mysql-test/suite/maria/maria-autozerofill.test
@@ -0,0 +1,111 @@
+# Test to verify that auto-zerofilling happens when a table is
+# imported from a different Aria instance
+
+# can't restart in embedded
+--source include/not_embedded.inc
+--source include/have_maria.inc
+
+call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
+
+let $MARIA_LOG=.;
+
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+create database mysqltest;
+let $mms_tname=t;
+
+connect (admin, localhost, root,,mysqltest,,);
+--enable_reconnect
+
+connection default;
+use mysqltest;
+--enable_reconnect
+
+# Create some tables for future tests
+create table t1(a int) engine=aria;
+insert into t1 values(1);
+create table t2 (a int) engine=aria;
+INSERT INTO t2 VALUES (1),(2);
+create table t3 (a int) engine=aria;
+INSERT INTO t3 VALUES (1),(2);
+create table t4 (a int) engine=aria;
+INSERT INTO t4 VALUES (1),(2);
+create table t5 (a int) engine=aria;
+INSERT INTO t5 VALUES (1),(2);
+flush tables;
+
+# Check that table is not zerofilled, not movable
+let $MYSQLD_DATADIR= `select @@datadir`;
+--exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt";
+ open(FILE, "<", $fname) or die;
+ my @content= <FILE>;
+ print grep(/Status:.*(zerofilled|movable)/, @content);
+ print "create_rename_lsn has non-magic value\n" if grep(/create_rename \([0-9]+/, @content);
+ close FILE;
+EOF
+
+# this will remove control file, so change the uuid of the Aria
+# instance, thus t1 will appear as imported from elsewhere.
+
+-- source include/maria_empty_logs.inc
+
+disable_ps_protocol; # see aria-recover.test
+replace_regex /Table.*t1/t1/ ;
+replace_result \\ /;
+select * from t1;
+enable_ps_protocol;
+flush table t1;
+
+# Check that table is auto-zerofilled, movable
+--exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt";
+ open(FILE, "<", $fname) or die;
+ my @content= <FILE>;
+ print grep(/Status:.*zerofilled/, @content);
+ print "create_rename_lsn has magic value\n" if grep(/create_rename \(0,0x2\)/, @content);
+ close FILE;
+EOF
+
+# this will attach t1 to the current Aria instance
+insert into t1 values(2);
+flush table t1;
+
+# Check that table is not zerofilled, not movable
+--exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt";
+ open(FILE, "<", $fname) or die;
+ my @content= <FILE>;
+ print grep(/Status:.*(zerofilled|movable)/, @content);
+ print "create_rename_lsn has non-magic value\n" if grep(/create_rename \([0-9]+/, @content);
+ close FILE;
+EOF
+
+#
+# BUG#44422 "mysql_upgrade destroys Maria tables?"
+# Check repair and optimize of moved table
+#
+check table t2;
+check table t2;
+repair table t2;
+check table t2;
+replace_result \\ /;
+optimize table t3;
+replace_result \\ /;
+analyze table t4;
+repair table t5;
+check table t5;
+repair table t5;
+check table t5;
+
+drop database mysqltest;