From 3ad9c30039028d28e99a5b7434d2f4f92e7cb590 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.blaudden" <> Date: Mon, 21 May 2007 11:33:58 +0200 Subject: [PATCH] Bug#27438 rpl_rotate_logs fails on Windows - Fix test case to work also when filesystem time differs from mysqld' time. I.e when running with data files on a network share. --- mysql-test/r/rpl_rotate_logs.result | 5 ++++- mysql-test/t/rpl_rotate_logs.test | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/mysql-test/r/rpl_rotate_logs.result b/mysql-test/r/rpl_rotate_logs.result index bf2ef98c87f..df42e76a0c8 100644 --- a/mysql-test/r/rpl_rotate_logs.result +++ b/mysql-test/r/rpl_rotate_logs.result @@ -50,7 +50,10 @@ show binary logs; Log_name File_size master-bin.000002 363 master-bin.000003 407 -purge master logs before now(); +select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND) +from information_schema.tables +where TABLE_SCHEMA="test" and TABLE_NAME="t2"; +purge master logs before (@time_for_purge); show binary logs; Log_name File_size master-bin.000003 407 diff --git a/mysql-test/t/rpl_rotate_logs.test b/mysql-test/t/rpl_rotate_logs.test index 5d9f1c29fe2..01f556c3c8f 100644 --- a/mysql-test/t/rpl_rotate_logs.test +++ b/mysql-test/t/rpl_rotate_logs.test @@ -107,9 +107,18 @@ show master logs; # we just tests if synonyms are accepted purge binary logs to 'master-bin.000002'; show binary logs; -# sleeping 10 seconds or more would make the slave believe connection is down ---real_sleep 1 -purge master logs before now(); + +# 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 +--disable_result_log +select @time_for_purge:=DATE_ADD(UPDATE_TIME, INTERVAL 1 SECOND) + from information_schema.tables + where TABLE_SCHEMA="test" and TABLE_NAME="t2"; +--enable_result_log + +purge master logs before (@time_for_purge); show binary logs; insert into t2 values (65); sync_slave_with_master;