summaryrefslogtreecommitdiff
path: root/mysql-test/include
diff options
context:
space:
mode:
authorunknown <guilhem@gbichot4.local>2007-12-31 00:04:17 +0100
committerunknown <guilhem@gbichot4.local>2007-12-31 00:04:17 +0100
commite580e058e53bc248c0abada7c41cc1d6e4cd4cdb (patch)
tree2a42b5f5c361fedae4d777325cd2dac8c98b25c2 /mysql-test/include
parent345451ce7644253988ba75bb1644d851dd659147 (diff)
downloadmariadb-git-e580e058e53bc248c0abada7c41cc1d6e4cd4cdb.tar.gz
Maria: more log handler fixes for when logs manually deleted
mysql-test/include/maria_empty_logs.inc: can now ask that control file be preserved mysql-test/lib/mtr_report.pl: expected warning (produced by translog_init() when log is missing) mysql-test/r/maria-recovery.result: result update mysql-test/t/maria-recovery.test: test of removing logs manually; recovery used to fail storage/maria/ma_loghandler.c: The addition to maria-recovery.test uncovered a bug: log 1 was manually deleted, Maria restarted, created log 2, then crash before a checkpoint: logs_found is TRUE, last_checkpoint_lsn is LSN_IMPOSSIBLE, so sure_page assumes that log 1 exists; using last_logno instead (only the last log needs to be checked, as the 'else' branch checks only after last_checkpoint_lsn: creation of a log is as good a starting point as a checkpoint, for scanning the log).
Diffstat (limited to 'mysql-test/include')
-rw-r--r--mysql-test/include/maria_empty_logs.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/mysql-test/include/maria_empty_logs.inc b/mysql-test/include/maria_empty_logs.inc
index 7613cea2a52..a24541717b0 100644
--- a/mysql-test/include/maria_empty_logs.inc
+++ b/mysql-test/include/maria_empty_logs.inc
@@ -1,7 +1,8 @@
# Maria help script.
# Cleans up all logs to give recovery a fresh start.
-# API: none, just uses vardir, port and socket.
+# API: set mel_keep_control_file=1 if want to keep control file;
+# uses vardir, port and socket.
connection admin;
@@ -12,7 +13,10 @@ EOF
--exec $MYSQLADMIN --no-defaults -S $MASTER_MYSOCK -P $MASTER_MYPORT -u root --password= shutdown 2>&1;
-remove_file $MYSQLTEST_VARDIR/master-data/maria_log_control;
+if (!$mel_keep_control_file)
+{
+ remove_file $MYSQLTEST_VARDIR/master-data/maria_log_control;
+}
remove_file $MYSQLTEST_VARDIR/master-data/maria_log.00000001;
-- error 0,1 # maybe there is just one log
remove_file $MYSQLTEST_VARDIR/master-data/maria_log.00000002;