summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <sasha@mysql.sashanet.com>2001-02-14 21:31:35 -0700
committerunknown <sasha@mysql.sashanet.com>2001-02-14 21:31:35 -0700
commit0fd8d82ab574c9c2e0b6bc01006b93d2c47a0aff (patch)
tree4dc4aeb764579d792c7799e59a7ab147ef8bad0a
parentdcd26ca7b9c5fc237c051045573dd8fd16163297 (diff)
parent9a17a41ed8b2778db19878e58bdbe3dc36534d9a (diff)
downloadmariadb-git-0fd8d82ab574c9c2e0b6bc01006b93d2c47a0aff.tar.gz
Merge work:/home/bk/mysql
into mysql.sashanet.com:/home/sasha/src/bk/mysql sql/slave.cc: Auto merged
-rw-r--r--mysql-test/r/rpl000002.result4
-rw-r--r--mysql-test/t/rpl000002.test19
-rw-r--r--sql/slave.cc3
3 files changed, 24 insertions, 2 deletions
diff --git a/mysql-test/r/rpl000002.result b/mysql-test/r/rpl000002.result
index 5b34f36bd05..a68ef517708 100644
--- a/mysql-test/r/rpl000002.result
+++ b/mysql-test/r/rpl000002.result
@@ -2,3 +2,7 @@ n
2000
2001
2002
+id created
+1 1970-01-01 06:25:45
+id created
+1 1970-01-01 06:25:45
diff --git a/mysql-test/t/rpl000002.test b/mysql-test/t/rpl000002.test
index c982bd54b8c..0c490e6316d 100644
--- a/mysql-test/t/rpl000002.test
+++ b/mysql-test/t/rpl000002.test
@@ -9,9 +9,26 @@ save_master_pos;
connection slave;
use test;
sync_with_master;
-@r/rpl000002.result select * from t1;
+select * from t1;
connection master;
drop table t1;
save_master_pos;
connection slave;
sync_with_master;
+slave stop;
+connection master;
+drop table if exists t2;
+create table t2(id int auto_increment primary key, created datetime);
+set timestamp=12345;
+insert into t2 set created=now();
+select * from t2;
+save_master_pos;
+connection slave;
+slave start;
+sync_with_master;
+select * from t2;
+connection master;
+drop table t2;
+save_master_pos;
+connection slave;
+sync_with_master;
diff --git a/sql/slave.cc b/sql/slave.cc
index f0e4236c29d..0c43c992c22 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -857,7 +857,8 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
thd->server_id = ev->server_id; // use the original server id for logging
thd->set_time(); // time the query
- ev->when = time(NULL);
+ if(!ev->when)
+ ev->when = time(NULL);
switch(type_code) {
case QUERY_EVENT: