MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Leonard Zhou Date:March 12 2009 9:51am
Subject:bzr commit into mysql-5.1-bugteam branch ( Bug#39858
View as plain text  
#At file:///home/zhl/mysql/rep/5.1/bug39858/

 2839 Leonard Zhou	2009-03-12
      BUG#39858 rpl.rpl_rotate (rpl.rpl_rotate_logs) failed on pushbuild: result mismatch
      The method to purge binary log files produces different results in some platforms.
      The reason is that the purge time is calculated based on table modified time and
      that can't guarantee to purge master-bin.000002 in all platforms.(eg. windows)
      Use a new way that sets the time to purge binlog file 1 second after the last
      modified time of master-bin.000002.
      That can be sure that the file is always deleted in any platform.

per-file messages:
    Test result
    Test file
=== modified file 'mysql-test/suite/rpl/r/rpl_rotate_logs.result'
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2009-03-11 15:19:18 +0000
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result	2009-03-12 09:48:41 +0000
@@ -87,9 +87,7 @@ show binary logs;
 Log_name	File_size
 master-bin.000002	#
 master-bin.000003	#
-select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
-from information_schema.tables
-where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+SELECT @time_for_purge:=DATE_ADD('tmpval', INTERVAL 1 SECOND);
 purge master logs before (@time_for_purge);
 show binary logs;
 Log_name	File_size

=== modified file 'mysql-test/suite/rpl/t/rpl_rotate_logs.test'
--- a/mysql-test/suite/rpl/t/rpl_rotate_logs.test	2009-03-11 15:19:18 +0000
+++ b/mysql-test/suite/rpl/t/rpl_rotate_logs.test	2009-03-12 09:48:41 +0000
@@ -112,14 +112,24 @@ source include/;
 purge binary logs to 'master-bin.000002';
 source include/;
-# Calculate time to use in "purge master logs before" by taking
-# last modification time of t2 and adding 1 second
-# This is donw in order to handle the case where file system
-# time differs from mysqld's time
+# Set the purge time 1 second after the last modify time of master-bin.000002.
+open F, ">>".$ENV{'MYSQLTEST_VARDIR'}.'/tmp/rpl_rotate_logs.tmp' or die "Tmp file rpl_rotate_logs.tmp not found";
+my $binlogpath = $ENV{'MYSQLTEST_VARDIR'}.'/mysqld.1/data/master-bin.000002';
+my @array = stat($binlogpath);
+my $filemodifytime = $array[9];
+my @t = localtime $filemodifytime;
+my $modifytime = sprintf "%04u-%02u-%02u %02u:%02u:%02u",$t[5]+1900,$t[4]+1,$t[3],$t[2],$t[1],$t[0];
+printf F ("let \$tmpval = %s;",$modifytime);
+close F;
+--source $MYSQLTEST_VARDIR/tmp/rpl_rotate_logs.tmp
+remove_file $MYSQLTEST_VARDIR/tmp/rpl_rotate_logs.tmp;
-select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND)
-  from information_schema.tables
-    where TABLE_SCHEMA="test" and TABLE_NAME="t2";
+--replace_result $tmpval tmpval
+--eval SELECT @time_for_purge:=DATE_ADD('$tmpval', INTERVAL 1 SECOND)
 purge master logs before (@time_for_purge);

bzr commit into mysql-5.1-bugteam branch ( Bug#39858Leonard Zhou12 Mar