mariadb/mysql-test/suite/maria/t/maria-autozerofill.test
Guilhem Bichot 704b4845aa merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.

mysys/thr_mutex.c:
  adding DBUG_PRINT here, so that we can locate where the warning is issued.
2009-02-12 15:08:56 +01:00

81 lines
2.4 KiB
Text

# Test to verify that auto-zerofilling happens when a table is
# imported from a different Maria instance
# can't restart in embedded
--source include/not_embedded.inc
--source include/have_maria.inc
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 table t1(a int) engine=maria;
insert into t1 values(1);
flush table t1;
# Check that table is not zerofilled, not movable
let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 Maria
# instance, thus t1 will appear as imported from elsewhere.
-- source include/maria_empty_logs.inc
disable_ps_protocol; # see maria-recover.test
replace_regex /Table.*t1/t1/ ;
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/mariachk.txt
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 Maria 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/mariachk.txt
perl;
use strict;
use warnings;
my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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
drop database mysqltest;