From: Date: February 25 2008 11:46pm Subject: bk commit into maria tree (guilhem:1.2613) List-Archive: http://lists.mysql.com/commits/42967 Message-Id: <200802252246.m1PMkEY2018186@mail.mysql.com> Below is the list of changes that have just been committed into a local maria repository of guilhem. When guilhem does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2008-02-25 23:46:01+01:00, guilhem@mysqlwin32. +1 -0 Fixes to how ma_test_recovery.pl uses --zerofill-keep-lsn storage/maria/unittest/ma_test_recovery.pl@stripped, 2008-02-25 23:45:57+01:00, guilhem@mysqlwin32. +26 -9 Tell how many tables were zerofilled (just for information, a varying number does not make the test fail). Don't let --zerofill-keep-lsn influence next runs (which it shouldn't do in theory anyway, but testing should not believe theory): restore non-zerofilled tables right after comparison is finished. diff -Nrup a/storage/maria/unittest/ma_test_recovery.pl b/storage/maria/unittest/ma_test_recovery.pl --- a/storage/maria/unittest/ma_test_recovery.pl 2008-02-25 17:31:49 +01:00 +++ b/storage/maria/unittest/ma_test_recovery.pl 2008-02-25 23:45:57 +01:00 @@ -18,6 +18,7 @@ my $tmp= "./tmp"; my $my_progname= $0; my $suffix; my $md5sum; +my $zerofilled_tables= 0; $my_progname=~ s/.*[\/]//; $maria_path= dirname($0) . "/.."; @@ -278,12 +279,13 @@ sub main # does not put back the "analyzed,optimized keys"(etc) index state. `diff -b $maria_path/unittest/ma_test_recovery.expected $tmp/ma_test_recovery.output`; if ($? >> 8) { - print "UNEXPECTED OUTPUT OF TESTS, FAILED\n"; + print "UNEXPECTED OUTPUT OF TESTS, FAILED"; + print " (zerofilled $zerofilled_tables tables)\n"; print "For more info, do diff -b $maria_path/unittest/ma_test_recovery.expected "; print "$tmp/ma_test_recovery.output\n"; exit(1); } - print "ALL RECOVERY TESTS OK\n"; + print "ALL RECOVERY TESTS OK (zerofilled $zerofilled_tables tables)\n"; } #### @@ -395,32 +397,47 @@ sub my_which sub physical_cmp { my ($table1, $table2)= @_; - my ($zerofilled, $ret_text); + my ($zerofilled, $ret_text)= (0, ""); + #return `cmp $table1.MAD $table2.MAD`.`cmp $table1.MAI $table2.MAI`; + # save original tables to restore them later foreach my $file_suffix ("MAD", "MAI") { my $file1= "$table1.$file_suffix"; my $file2= "$table2.$file_suffix"; - my ($error_text, $differences_text)= - ("error in comparison of $file1 and $file2\n", - "$file1 and $file2 differ\n"); my $res= File::Compare::compare($file1, $file2); - return $error_text if ($res == -1); + die() if ($res == -1); if ($res == 1 # they differ and !$zerofilled) { # let's try with --zerofill-keep-lsn $zerofilled= 1; # but no need to do it twice + $zerofilled_tables= $zerofilled_tables + 1; + my $table_no= 1; foreach my $table ($table1, $table2) { + copy("$table.MAD", "$tmp/before_zerofill$table_no.MAD") || die(); + copy("$table.MAI", "$tmp/before_zerofill$table_no.MAI") || die(); $com= "$maria_exe_path/maria_chk$suffix -s --zerofill-keep-lsn $table"; $res= `$com`; print MY_LOG $res; + $table_no= $table_no + 1; } $res= File::Compare::compare($file1, $file2); - return $error_text if ($res == -1); + die() if ($res == -1); } - $ret_text.= $differences_text if ($res != 0); + $ret_text.= "$file1 and $file2 differ\n" if ($res != 0); } + if ($zerofilled) + { + my $table_no= 1; + foreach my $table ($table1, $table2) + { + move("$tmp/before_zerofill$table_no.MAD", "$table.MAD") || die(); + move("$tmp/before_zerofill$table_no.MAI", "$table.MAI") || die(); + $table_no= $table_no + 1; + } + } + return $ret_text; }