| 1 |
# This test checks scenario of recovery executed on data directory with redo |
| 2 |
# file that has broken checkpoint_lsn (pointing outside the file) |
| 3 |
|
| 4 |
# According to perl's documentation, 'Q' in (un)pack() is supported only if perl |
| 5 |
# has been compiled with support for 64bit integers. |
| 6 |
# The log_file_get_checkpoint_lsn(), which is used in this test, uses |
| 7 |
# unpack('Q>'). |
| 8 |
--source include/have_perl_64bit_int.inc |
| 9 |
|
| 10 |
let $MYSQLD_SOCKET= `SELECT @@socket`; |
| 11 |
--source include/stop_mysqld.inc |
| 12 |
|
| 13 |
let $tmp_dir = $MYSQLTEST_VARDIR/tmp; |
| 14 |
let MYSQLD_DATADIR = $tmp_dir/log_invalid_file; |
| 15 |
let MYSQLD_ERROR_LOG = $tmp_dir/my_restart.err; |
| 16 |
let SEARCH_FILE = $MYSQLD_ERROR_LOG; |
| 17 |
|
| 18 |
--echo # Initialize new data directory... |
| 19 |
--source include/initialize_datadir.inc |
| 20 |
|
| 21 |
perl; |
| 22 |
require 'include/ib_redo_log_files.inc'; |
| 23 |
my $fpath = ''; |
| 24 |
my $max_checkpoint_lsn = 0; |
| 25 |
for my $f (log_get_non_tmp_files()) { |
| 26 |
$fpath = $f; |
| 27 |
my $checkpoint_lsn = log_file_get_checkpoint_lsn($fpath); |
| 28 |
if ($checkpoint_lsn > $max_checkpoint_lsn) { |
| 29 |
$max_checkpoint_lsn = $checkpoint_lsn; |
| 30 |
} |
| 31 |
} |
| 32 |
my $result_file_path = "$ENV{'MYSQLD_DATADIR'}/found.inc"; |
| 33 |
open my $fh, '>', $result_file_path or die "open failed: $!\n"; |
| 34 |
syswrite($fh, "let REDO_CHECKPOINT_LSN=$max_checkpoint_lsn;\n") > 0 or die "write failed: $!\n"; |
| 35 |
close $fh or die "close failed: $!\n"; |
| 36 |
EOF |
| 37 |
|
| 38 |
--source $MYSQLD_DATADIR/found.inc |
| 39 |
|
| 40 |
--error 1,42 |
| 41 |
--exec $MYSQLD --no-defaults $MYSQLD_ARGS --innodb-unknown-param=y |
| 42 |
let SEARCH_PATTERN = The latest found checkpoint is at lsn = $REDO_CHECKPOINT_LSN in redo log file; |
| 43 |
--replace_result $REDO_CHECKPOINT_LSN REDO_CHECKPOINT_LSN |
| 44 |
--source include/search_pattern.inc |
| 45 |
let SEARCH_PATTERN = innodb-unknown-param; |
| 46 |
--source include/search_pattern.inc |
| 47 |
|
| 48 |
--move_file $SEARCH_FILE $MYSQLTEST_VARDIR/log/log_file_checkpoint.err |
| 49 |
|
| 50 |
--force-rmdir $MYSQLD_DATADIR |
| 51 |
|
| 52 |
let MYSQLD_ARGS=; |
| 53 |
let MYSQLD_DATADIR=; |
| 54 |
let MYSQLD_ERROR_LOG=; |
| 55 |
|
| 56 |
--source include/start_mysqld.inc |