diff options
Diffstat (limited to 'mysql-test/suite/maria/maria-page-checksum.test')
-rw-r--r-- | mysql-test/suite/maria/maria-page-checksum.test | 1557 |
1 files changed, 1557 insertions, 0 deletions
diff --git a/mysql-test/suite/maria/maria-page-checksum.test b/mysql-test/suite/maria/maria-page-checksum.test new file mode 100644 index 00000000..d35e2963 --- /dev/null +++ b/mysql-test/suite/maria/maria-page-checksum.test @@ -0,0 +1,1557 @@ +# Tests for two bugs related to ALTER TABLE and aria-specific alter +# options (PAGE_CHECKSUM and TRANSACTIONAL). + +-- source include/have_maria.inc + +--disable_warnings +drop table if exists t1; +--enable_warnings + +# +# Test for BUG#35441 "Cannot change PAGE_CHECKSUM table option" +# + +let $MYSQLD_DATADIR= `select @@datadir`; + +select @@global.aria_page_checksum; + +# we scan through combinations in the cartesian product of +# (first value of aria_page_checksum) x (clauses in CREATE TABLE) x +# (second value of aria_page_checksum) x (clauses in ALTER TABLE). + +--echo # iteration 1a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 2a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 3a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 4a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 5a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 6a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 7a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 8a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 9a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 10a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 11a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 12a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 13a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 14a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 15a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 16a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 17a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 18a +set global aria_page_checksum = 0 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 19a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 20a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 21a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 22a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 23a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 24a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 25a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 26a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 27a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 28a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 29a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 30a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 31a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 32a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 33a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 0 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 34a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 engine=aria ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 35a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=0 ; +show create table t1 /* expecting PAGE_CHECKSUM=0 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +--echo # iteration 36a +set global aria_page_checksum = 1 ; +create table t1(a int) engine=aria PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +set global aria_page_checksum = 1 ; +alter table t1 PAGE_CHECKSUM=1 ; +show create table t1 /* expecting PAGE_CHECKSUM=1 */ ; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/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= grep(/Page checksums are used/, <FILE>); + print @content ? $content[0] : "Page checksums are not used\n"; + close FILE; +EOF +drop table t1; + +# +# Test for BUG#37005 +# "Aria: ALTER TABLE TRANSACTIONAL=0 leaves table transactional inside Aria" +# + +# we scan through combinations in the cartesian product of +# (clauses in CREATE TABLE) x (clauses in ALTER TABLE). + +--echo # iteration 1b +create table t1(a int) engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 modify a bigint ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 2b +create table t1(a int) engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 3b +create table t1(a int) engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 4b +create table t1(a int) engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 5b +create table t1(a int) engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 6b +create table t1(a int) engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 7b +create table t1(a int) engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 modify a bigint ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 8b +create table t1(a int) engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 9b +create table t1(a int) engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 10b +create table t1(a int) engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 11b +create table t1(a int) engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 12b +create table t1(a int) engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 13b +create table t1(a int) engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 modify a bigint ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 14b +create table t1(a int) engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 15b +create table t1(a int) engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 16b +create table t1(a int) engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 17b +create table t1(a int) engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria transactional=0 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; + + +--echo # iteration 18b +create table t1(a int) engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF + +alter table t1 engine=aria transactional=1 ; +show create table t1; +--exec $MARIA_CHK -dv $MYSQLD_DATADIR/test/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt +perl; + use strict; + use warnings; + my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/ariachk.txt"; + open(FILE, "<", $fname) or die; + print grep(/Crashsafe/, <FILE>); + close FILE; +EOF +drop table t1; |