summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2008-06-26 12:32:22 +0300
committerMichael Widenius <monty@mysql.com>2008-06-26 12:32:22 +0300
commit1d726038324e9ed977b9b1a7d2ebf90ca647db9d (patch)
treed65ab7be01ae6f1c020c007ae7524eef204d2cc1 /mysql-test/t
parent52cb0c24a6a6674ee17c4bb86fa02527043ed90f (diff)
parent4f14b87d9131877841558fe6afe2832f6aba31a7 (diff)
downloadmariadb-git-1d726038324e9ed977b9b1a7d2ebf90ca647db9d.tar.gz
Merge; No notable changes
.bzr-mysql/default.conf: Automatic merge config/ac-macros/plugins.m4: Automatic merge configure.in: Automatic merge include/my_global.h: Automatic merge mysql-test/include/maria_empty_logs.inc: Use Guilmhems version, but don't echo use database mysql-test/r/maria-no-logging.result: Automatic merge mysql-test/r/maria-page-checksum.result: Automatic merge mysql-test/r/maria-recover.result: Automatic merge mysql-test/r/maria2.result: Automatic merge mysql-test/t/maria-no-logging.test: Automatic merge mysql-test/t/maria-page-checksum.test: Automatic merge mysql-test/t/maria-purge.test: Automatic merge mysql-test/t/maria-recover.test: Automatic merge mysql-test/t/maria2.test: Automatic merge sql/sql_table.cc: Automatic merge storage/maria/CMakeLists.txt: Automatic merge storage/maria/ma_ft_parser.c: Automatic merge storage/maria/ma_loghandler.c: Automatic merge storage/maria/ma_recovery.c: Automatic merge storage/maria/ma_rt_test.c: Manual merge storage/maria/ma_state.c: Automatic merge storage/maria/ma_test_force_start.pl: Automatic merge storage/maria/plug.in: Automatic merge storage/maria/unittest/CMakeLists.txt: Automatic merge storage/maria/unittest/Makefile.am: Automatic merge storage/maria/unittest/ma_test_all-t: Automatic merge storage/maria/unittest/ma_test_loghandler_multithread-t.c: Automatic merge storage/maria/unittest/ma_test_recovery.pl: Automatic merge storage/myisam/rt_test.c: Automatic merge
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/maria-no-logging.test81
-rw-r--r--mysql-test/t/maria-page-checksum.test509
-rw-r--r--mysql-test/t/maria-purge.test14
-rw-r--r--mysql-test/t/maria-recover.test1
-rw-r--r--mysql-test/t/maria2.test66
5 files changed, 663 insertions, 8 deletions
diff --git a/mysql-test/t/maria-no-logging.test b/mysql-test/t/maria-no-logging.test
new file mode 100644
index 00000000000..8ed2dbad338
--- /dev/null
+++ b/mysql-test/t/maria-no-logging.test
@@ -0,0 +1,81 @@
+# test of cases where we can safely disable logging
+
+--source include/have_maria.inc
+
+set global maria_log_file_size=4294967295;
+
+--disable_warnings
+drop database if exists mysqltest;
+--enable_warnings
+create database mysqltest;
+
+connect (admin, 127.0.0.1, root,,mysqltest,,);
+--enable_reconnect
+
+connection default;
+use mysqltest;
+--enable_reconnect
+
+# checkpoints can make log unrepeatable
+let $def_checkinterval=`select @@global.maria_checkpoint_interval`;
+set global maria_checkpoint_interval=0;
+
+# Prepare table to help for big load
+create table t2 (a varchar(100)) engine=myisam;
+insert into t2 select repeat('z',100);
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+insert into t2 select * from t2;
+
+# INSERT SELECT
+
+# no optimization because table not empty
+
+# SHOW ENGINE MARIA LOGS could be influenced by older logs
+-- source include/maria_empty_logs.inc
+create table t1 (a varchar(100)) engine=maria transactional=1;
+show create table t1;
+--replace_regex /; .+maria_log/maria_log/
+show engine maria logs;
+
+insert into t1 values('a');
+insert into t1 select * from t2;
+--replace_regex /; .+maria_log/maria_log/
+show engine maria logs;
+
+# optimization because table is empty
+-- source include/maria_empty_logs.inc
+truncate table t1;
+insert into t1 select * from t2;
+--replace_regex /; .+maria_log/maria_log/
+show engine maria logs;
+
+drop table t1;
+
+# same for CREATE SELECT
+
+# no optimization because table not empty
+-- source include/maria_empty_logs.inc
+create table t1 (a varchar(100)) engine=maria transactional=1;
+insert into t1 values('a');
+create table if not exists t1 select * from t2;
+--replace_regex /; .+maria_log/maria_log/
+show engine maria logs;
+
+# optimization because table is empty
+-- source include/maria_empty_logs.inc
+drop table t1;
+create table t1 engine=maria transactional=1 select * from t2;
+--replace_regex /; .+maria_log/maria_log/
+show engine maria logs;
+
+drop database mysqltest;
+
+--disable_result_log
+--disable_query_log
+eval set global maria_checkpoint_interval=$def_checkinterval;
+--enable_result_log
+--enable_query_log
diff --git a/mysql-test/t/maria-page-checksum.test b/mysql-test/t/maria-page-checksum.test
index 6c7c5afc2a5..e0a0a1517b1 100644
--- a/mysql-test/t/maria-page-checksum.test
+++ b/mysql-test/t/maria-page-checksum.test
@@ -1,7 +1,5 @@
-#
-# This can't be run with --extern as we are acccessing the tables in the
-# database directly
-#
+# Tests for two bugs related to ALTER TABLE and maria-specific alter
+# options (PAGE_CHECKSUM and TRANSACTIONAL).
-- source include/have_maria.inc
@@ -9,8 +7,16 @@
drop table if exists t1;
--enable_warnings
+#
+# Test for BUG#35441 "Cannot change PAGE_CHECKSUM table option"
+#
+
select @@global.maria_page_checksum;
+# we scan through combinations in the cartesian product of
+# (first value of maria_page_checksum) x (clauses in CREATE TABLE) x
+# (second value of maria_page_checksum) x (clauses in ALTER TABLE).
+
--echo # iteration 1
set global maria_page_checksum = 0 ;
create table t1(a int) engine=maria ;
@@ -1054,3 +1060,498 @@ perl;
close FILE;
EOF
drop table t1;
+
+#
+# Test for BUG#37005
+# "Maria: ALTER TABLE TRANSACTIONAL=0 leaves table transactional inside Maria"
+#
+
+# we scan through combinations in the cartesian product of
+# (clauses in CREATE TABLE) x (clauses in ALTER TABLE).
+
+--echo # iteration 1
+create table t1(a int) engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 2
+create table t1(a int) engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 3
+create table t1(a int) engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 4
+create table t1(a int) engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 5
+create table t1(a int) engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 6
+create table t1(a int) engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 7
+create table t1(a int) engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 8
+create table t1(a int) engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 9
+create table t1(a int) engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 10
+create table t1(a int) engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 11
+create table t1(a int) engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 12
+create table t1(a int) engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 13
+create table t1(a int) engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 14
+create table t1(a int) engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 15
+create table t1(a int) engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.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 $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 16
+create table t1(a int) engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 17
+create table t1(a int) engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria transactional=0 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
+--echo # iteration 18
+create table t1(a int) engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+
+alter table t1 engine=maria transactional=1 ;
+show create table t1;
+--exec $MARIA_CHK -dv $MYSQLTEST_VARDIR/master-data/test/t1 >$MYSQLTEST_VARDIR/tmp/mariachk.txt
+perl;
+ use strict;
+ use warnings;
+ my $fname= "$ENV{'MYSQLTEST_VARDIR'}/tmp/mariachk.txt";
+ open(FILE, "<", $fname) or die;
+ print grep(/Crashsafe/, <FILE>);
+ close FILE;
+EOF
+drop table t1;
+
+
diff --git a/mysql-test/t/maria-purge.test b/mysql-test/t/maria-purge.test
index 48f69e25bd9..7ab35aa45e0 100644
--- a/mysql-test/t/maria-purge.test
+++ b/mysql-test/t/maria-purge.test
@@ -1,13 +1,18 @@
-- source include/have_maria.inc
-- source include/big_test.inc
-#
-# Empty logs to get log file numbers repeatable
+# pre-requisites for maria_empty_logs
+connect (admin, 127.0.0.1, root,,test,,);
#
--enable_reconnect
-connect (admin, localhost, root,,);
+connection default;
--enable_reconnect
---source include/maria_empty_logs.inc
+# end of pre-requisites
+
+# SHOW ENGINE MARIA LOGS could be influenced by older logs
+# Also, possibly automatic checkpoints (see if that happens in
+# practice)
+-- source include/maria_empty_logs.inc
let $default=`select @@global.storage_engine`;
set global storage_engine=maria;
@@ -56,6 +61,7 @@ insert into t2 select * from t1;
insert into t1 select * from t2;
set global maria_log_file_size=16777216;
+# force a checkpoint to allow log purge
eval set global maria_checkpoint_interval=$def_checkinterval;
--replace_regex /Size +[0-9]+ ; .+master-data/master-data/
SHOW ENGINE maria logs;
diff --git a/mysql-test/t/maria-recover.test b/mysql-test/t/maria-recover.test
index d6604d8f94e..83729c6bd46 100644
--- a/mysql-test/t/maria-recover.test
+++ b/mysql-test/t/maria-recover.test
@@ -48,6 +48,7 @@ EOF
# line below will be removed
disable_ps_protocol;
+replace_regex /.mysqltest.t_corrupted2/t_corrupted2/ ;
select * from t_corrupted2; # should show corruption and repair messages
enable_ps_protocol;
select * from t_corrupted2; # should show just rows
diff --git a/mysql-test/t/maria2.test b/mysql-test/t/maria2.test
new file mode 100644
index 00000000000..0127ec388ed
--- /dev/null
+++ b/mysql-test/t/maria2.test
@@ -0,0 +1,66 @@
+--source include/have_maria.inc
+
+# Test for BUG#36319
+# "Maria: table is not empty but DELETE and SELECT find no rows"
+
+CREATE TABLE t1 (
+ line BLOB,
+ kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
+ name VARCHAR(32)
+) transactional=0 row_format=page engine=maria;
+
+let $query= INSERT INTO t1 (name, kind, line) VALUES
+ ("Aadaouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
+ ("Aadassiye", "pp", GeomFromText("POINT(35.816667 36.216667)")),
+ ("Aadbel", "pp", GeomFromText("POINT(34.533333 36.100000)")),
+ ("Aadchit", "pp", GeomFromText("POINT(33.347222 35.423611)")),
+ ("Aadchite", "pp", GeomFromText("POINT(33.347222 35.423611)")),
+ ("Aadchit el Qoussair", "pp", GeomFromText("POINT(33.283333 35.483333)")),
+ ("Aaddaye", "pp", GeomFromText("POINT(36.716667 40.833333)")),
+ ("'Aadeissa", "pp", GeomFromText("POINT(32.823889 35.698889)")),
+ ("Aaderup", "pp", GeomFromText("POINT(55.216667 11.766667)")),
+ ("Qalaat Aades", "pp", GeomFromText("POINT(33.503333 35.377500)")),
+ ("A ad'ino", "pp", GeomFromText("POINT(54.812222 38.209167)")),
+ ("Aadi Noia", "pp", GeomFromText("POINT(13.800000 39.833333)")),
+ ("Aad La Macta", "pp", GeomFromText("POINT(35.779444 -0.129167)")),
+ ("Aadland", "pp", GeomFromText("POINT(60.366667 5.483333)")),
+ ("Aadliye", "pp", GeomFromText("POINT(33.366667 36.333333)")),
+ ("Aadloun", "pp", GeomFromText("POINT(33.403889 35.273889)")),
+ ("Aadma", "pp", GeomFromText("POINT(58.798333 22.663889)")),
+ ("Aadma Asundus", "pp", GeomFromText("POINT(58.798333 22.663889)")),
+ ("Aadmoun", "pp", GeomFromText("POINT(34.150000 35.650000)")),
+ ("Aadneram", "pp", GeomFromText("POINT(59.016667 6.933333)")),
+ ("Aadneskaar", "pp", GeomFromText("POINT(58.083333 6.983333)")),
+ ("Aadorf", "pp", GeomFromText("POINT(47.483333 8.900000)")),
+ ("Aadorp", "pp", GeomFromText("POINT(52.366667 6.633333)")),
+ ("Aadouane", "pp", GeomFromText("POINT(32.816667 35.983333)")),
+ ("Aadoui", "pp", GeomFromText("POINT(34.450000 35.983333)")),
+ ("Aadouiye", "pp", GeomFromText("POINT(34.583333 36.183333)")),
+ ("Aadouss", "pp", GeomFromText("POINT(33.512500 35.601389)")),
+ ("Aadra", "pp", GeomFromText("POINT(33.616667 36.500000)")),
+ ("Aadzi", "pp", GeomFromText("POINT(38.100000 64.850000)"));
+
+--disable_query_log
+let $1=90;
+while($1)
+{
+ eval $query;
+ dec $1;
+}
+let $1=90;
+while($1)
+{
+ delete from t1 limit 1;
+ delete from t1 limit 10;
+ delete from t1 limit 7;
+ delete from t1 limit 2;
+ dec $1;
+}
+--enable_query_log
+
+select count(*) from t1;
+delete from t1 limit 1000;
+select count(*) from t1;
+select name from t1;
+check table t1 extended;
+drop table t1;