1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
# According to perl's documentation, 'Q' in (un)pack() is supported only if perl
# has been compiled with support for 64bit integers.
--source include/have_perl_64bit_int.inc
--source log_pre_8_0_30_case_begin.inc
--echo ############################################################################################
--echo # Case 7: Attempt to start on non-empty redo files.
--echo # 7A: InnoDB refuses to start on logically non-empty redo log.
--echo # 7B: InnoDB refuses to start when the first log block is corrupted (invalid checksum).
--echo ############################################################################################
--echo # Update data_len field to 512 in the data block containing the checkpoint_lsn...
perl;
# Find the oldest checkpoint lsn and related offset:
open my $fh, '+<:raw', $ENV{IB_LOGFILE0_PATH} or die "open failed: $!\n";
my $offset1 = 512 + 8;
my $offset2 = 3*512 + 8;
seek $fh, $offset1, 0;
read $fh, my $packed_checkpoint_lsn1, 8 or die "read failed: $!\n";
seek $fh, $offset2, 0;
read $fh, my $packed_checkpoint_lsn2, 8 or die "read failed: $!\n";
my $checkpoint_lsn1 = unpack('Q>', $packed_checkpoint_lsn1);
my $checkpoint_lsn2 = unpack('Q>', $packed_checkpoint_lsn2);
my $offset = 0;
if ($checkpoint_lsn1 <= $checkpoint_lsn2) {
$offset = $offset1;
} else {
$offset = $offset2;
}
$offset += 8;
seek $fh, $offset, 0;
read $fh, my $packed_checkpoint_offset, 8 or die "read failed: $!\n";
my $checkpoint_offset = unpack('Q>', $packed_checkpoint_offset);
close $fh or die "close failed: $!\n";
# Compute file and block pointed by the checkpoint offset:
my $file_size = -s $ENV{IB_LOGFILE0_PATH};
my $nth_file = $checkpoint_offset / $file_size % 2;
my $file_path = '';
if ($nth_file == 0) {
$file_path = $ENV{IB_LOGFILE0_PATH};
} else {
$file_path = $ENV{IB_LOGFILE1_PATH};
}
my $file_offset = $checkpoint_offset % $file_size;
my $block_offset = int($file_offset / 512) * 512;
# Open the pointed file and update the data_len field:
open $fh, '+<:raw', $file_path or die "open failed: $!\n";
seek $fh, $block_offset + 4, 0;
syswrite($fh, pack('S>', 512), 2) == 2 or die "write failed: $!\n";
close $fh or die "close failed: $!\n";
EOF
let $i = 1;
while ($i <= 2) {
--remove_file $SEARCH_FILE
--echo # Case 7A: Start MySQL... (attempt $i)
--error 1,42
--exec $MYSQLD_CMD $MYSQLD_ARGS --innodb-log-checksums=OFF --$UNKNOWN_PARAM
--echo # Verify...
let SEARCH_PATTERN = Upgrade is not supported after a crash or shutdown with innodb_fast_shutdown = 2.* appears logically non empty;
# Expected: found
--source include/search_pattern.inc
let SEARCH_PATTERN = Upgrading redo log: .*, LSN=;
# Expected: not found
--source include/search_pattern.inc
let SEARCH_PATTERN = $PATTERN_UNKNOWN_PARAM;
# Expected: not found
--source include/search_pattern.inc
inc $i;
}
--echo ############################################################################################
let $i = 1;
while ($i <= 2) {
--remove_file $SEARCH_FILE
--echo # Case 7B: Start MySQL... (attempt $i)
--error 1,42
--exec $MYSQLD_CMD $MYSQLD_ARGS --$UNKNOWN_PARAM
--echo # Verify...
let SEARCH_PATTERN = Upgrade after a crash is not supported.* appears corrupted;
# Expected: found
--source include/search_pattern.inc
let SEARCH_PATTERN = Upgrading redo log: .*, LSN=;
# Expected: not found
--source include/search_pattern.inc
let SEARCH_PATTERN = $PATTERN_UNKNOWN_PARAM;
# Expected: not found
--source include/search_pattern.inc
inc $i;
}
--echo ############################################################################################
--source log_pre_8_0_30_case_end.inc
|