Commit 12ed50cc authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-15767 innodb.101_compatibility fails

The test innodb.101_compatibility occasionally fails, because the flags
for the tables tdd and tp are not always converted back. Thus, the
second attempt of corrupting the flags will update garbage to garbage,
and cause test failure.

This started failing related to one or two MDEV-12266 commits affecting
the function fsp_flags_try_adjust().

fsp_flags_try_adjust(): If the file has not been opened (space->size==0),
try determining its size by reading the file. Only if the file is not
readable, give up.

Also, avoid dummy writes in the Perl script, and add some instrumentation.
parent b7ea5634
......@@ -15,10 +15,14 @@ sub convert_to_mariadb_101
$badflags |= 1<<6|$compression_level<<7 if ($flags & 1 << 16);
$badflags |= ($flags & 15 << 6) << 7; # PAGE_SSIZE
substr ($_, 54, 4) = pack("N", $badflags);
# Replace the innodb_checksum_algorithm=none checksum
substr ($_, 0, 4) = pack("N", 0xdeadbeef);
substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
if ($badflags != $flags)
{
warn "$file: changing $flags to $badflags\n";
substr ($_, 54, 4) = pack("N", $badflags);
# Replace the innodb_checksum_algorithm=none checksum
substr ($_, 0, 4) = pack("N", 0xdeadbeef);
substr ($_, $page_size - 8, 4) = pack("N", 0xdeadbeef);
syswrite(FILE, $_, $page_size)==$page_size||die "Unable to write $file\n";
}
close(FILE);
}
......@@ -4156,7 +4156,8 @@ void fsp_flags_try_adjust(fil_space_t* space, ulint flags)
{
ut_ad(!srv_read_only_mode);
ut_ad(fsp_flags_is_valid(flags, space->id));
if (!space->size) {
if (!space->size && (space->purpose != FIL_TYPE_TABLESPACE
|| !fil_space_get_size(space->id))) {
return;
}
/* This code is executed during server startup while no
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment