summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2018-04-04 08:21:53 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2018-04-04 08:22:33 +0300
commit12ed50cc8d20cc09e302e5dad9ed6a4a6d4ca222 (patch)
tree8306e9651e7227b7a5cd4893c64163d6ea161354
parentb7ea56349189489e0276ad78a27214b8f76193ef (diff)
downloadmariadb-git-12ed50cc8d20cc09e302e5dad9ed6a4a6d4ca222.tar.gz
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.
-rw-r--r--mysql-test/suite/innodb/include/ibd_convert.pl14
-rw-r--r--storage/innobase/fil/fil0fil.cc3
2 files changed, 11 insertions, 6 deletions
diff --git a/mysql-test/suite/innodb/include/ibd_convert.pl b/mysql-test/suite/innodb/include/ibd_convert.pl
index bb9dfbe74b8..9327de6d79a 100644
--- a/mysql-test/suite/innodb/include/ibd_convert.pl
+++ b/mysql-test/suite/innodb/include/ibd_convert.pl
@@ -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);
}
diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc
index fe7af34be2e..e9fbc2545e3 100644
--- a/storage/innobase/fil/fil0fil.cc
+++ b/storage/innobase/fil/fil0fil.cc
@@ -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