diff options
Diffstat (limited to 'mysql-test/suite/innodb/t/row_format_redundant.test')
-rw-r--r-- | mysql-test/suite/innodb/t/row_format_redundant.test | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mysql-test/suite/innodb/t/row_format_redundant.test b/mysql-test/suite/innodb/t/row_format_redundant.test index fc72e5c2664..6f38835d7e9 100644 --- a/mysql-test/suite/innodb/t/row_format_redundant.test +++ b/mysql-test/suite/innodb/t/row_format_redundant.test @@ -96,6 +96,9 @@ do "$ENV{MTR_SUITE_DIR}/include/crc32.pl"; my $ps= $ENV{INNODB_PAGE_SIZE}; my $file= "$ENV{bugdir}/ibdata1"; open(FILE, "+<", $file) || die "Unable to open $file\n"; +die "Unable to read $file" unless sysread(FILE, $_, $ps) == $ps; +my $full_crc32 = unpack("N",substr($_,54,4)) & 0x10; # FIL_SPACE_FLAGS; +sysseek(FILE, 0, 0) || die "Unable to seek $file"; # Read DICT_HDR_TABLES, the root page number of CLUST_IND (SYS_TABLES.NAME). sysseek(FILE, 7*$ps+38+32, 0) || die "Unable to seek $file"; die "Unable to read $file" unless sysread(FILE, $_, 4) == 4; @@ -122,10 +125,16 @@ for (my $offset= 0x65; $offset; } } my $polynomial = 0x82f63b78; # CRC-32C -my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^ +if ($full_crc32) { + my $ck = mycrc32(substr($page, 0, $ps-4), 0, $polynomial); + substr($page, $ps-4, 4) = pack("N", $ck); +} else { + my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^ mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial)); -substr($page,0,4)=$ck; -substr($page,$ps-8,4)=$ck; + substr($page,0,4)=$ck; + substr($page,$ps-8,4)=$ck; +} + sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n"; close(FILE) || die "Unable to close $file\n"; |