summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl_server_id1.test
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-04-28 18:24:46 +0200
committerunknown <guilhem@mysql.com>2004-04-28 18:24:46 +0200
commit87a93a3195c40e9964da45ae3f1b159640b3b0e3 (patch)
tree4dc6a90359310c5dfb787550d9255ad52964cc27 /mysql-test/t/rpl_server_id1.test
parentb825d9b023071039dfbda8324427102533319cb4 (diff)
downloadmariadb-git-87a93a3195c40e9964da45ae3f1b159640b3b0e3.tar.gz
A new option --replicate-same-server-id to force a slave to execute queries originating from itself
(WL#794). This can be of interest in some recovery-from-backup scenarios, and also when you have two databases in one mysqld, having a certain similarity and you want one db to be updated when the other is (some sort of trigger). Plus small fix for BUG#3568 "MySQL server crashes when built --with-debug and CHANGE MASTER +MASTER_POS_WAIT" sql/mysqld.cc: new option --replicate-same-server-id sql/slave.cc: new option replicate_same_server_id, to force a slave to execute its own queries. Small fix for BUG#3568 "MySQL server crashes when built --with-debug and CHANGE MASTER +MASTER_POS_WAIT" sql/slave.h: new option --replicate-same-server-id
Diffstat (limited to 'mysql-test/t/rpl_server_id1.test')
-rw-r--r--mysql-test/t/rpl_server_id1.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/rpl_server_id1.test b/mysql-test/t/rpl_server_id1.test
new file mode 100644
index 00000000000..551d8432cd8
--- /dev/null
+++ b/mysql-test/t/rpl_server_id1.test
@@ -0,0 +1,22 @@
+# This test checks that a slave does not execute queries originating
+# from itself, by default.
+
+source include/master-slave.inc;
+connection slave;
+drop table if exists t1;
+create table t1 (n int);
+reset master;
+# replicate ourselves
+stop slave;
+eval change master to master_port=$SLAVE_MYPORT;
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--replace_column 18 #
+show slave status;
+start slave;
+insert into t1 values (1);
+# can't MASTER_POS_WAIT(), it does not work in this weird setup
+# (when slave is its own master without --replicate-same-server-id)
+sleep 2; # enough time for the event to be replicated (it should not)
+show status like "slave_running";
+select * from t1;
+drop table t1;