diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-03-13 09:55:41 +0100 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-03-13 09:55:41 +0100 |
commit | 9db5b7d4f5355328bf1c77d7031af20baba924c4 (patch) | |
tree | 326a967e25fcfd2c85c3f5a3c57ae03bfb3db6a8 /mysql-test/t/ndb_binlog_multi.test | |
parent | 3364f871d48fe852f6914f4938b8331d81c78a3b (diff) | |
download | mariadb-git-9db5b7d4f5355328bf1c77d7031af20baba924c4.tar.gz |
changed test to make it predictable
sql/ha_ndbcluster_binlog.cc:
removing non critical assert
Diffstat (limited to 'mysql-test/t/ndb_binlog_multi.test')
-rw-r--r-- | mysql-test/t/ndb_binlog_multi.test | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/mysql-test/t/ndb_binlog_multi.test b/mysql-test/t/ndb_binlog_multi.test index ed38c50d997..6adacf73208 100644 --- a/mysql-test/t/ndb_binlog_multi.test +++ b/mysql-test/t/ndb_binlog_multi.test @@ -9,28 +9,26 @@ connection server1; drop table if exists t1,t2; --enable_warnings +# reset for test +connection server1; +reset master; +connection server2; +reset master; + # # basic test to see if one server sees the table from the other # and sets up the replication correctly # -# no tables and nothing in cluster.binlog_index; -connection server1; -SHOW TABLES; - # create table on the other server connection server2; CREATE TABLE t2 (a INT PRIMARY KEY, b int) ENGINE = NDB; -# make sure the first mysql server knows about this table -connection server1; -show tables; - # insert something on server2 -connection server2; INSERT INTO t2 VALUES (1,1),(2,2); +# verify that we get the data in the binlog +--source include/show_binlog_events.inc select * from t2 order by a; -save_master_pos; --replace_column 1 <the_epoch> SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM cluster.binlog_index ORDER BY epoch DESC LIMIT 1; @@ -39,16 +37,25 @@ let $the_epoch= `SELECT @the_epoch`; # see if we got something on server1 connection server1; SELECT * FROM t2 ORDER BY a; +# doing drop table will ensure that all the events have been received +DROP TABLE t2; +# verify thar we have table and data in binlog +--source include/show_binlog_events.inc --replace_result $the_epoch <the_epoch> eval SELECT inserts,updates,deletes,schemaops FROM cluster.binlog_index WHERE epoch=$the_epoch; +# reset for next test +connection server1; +reset master; +connection server2; +reset master; + # single schema ops will not show -# drop the table on server1 -DROP TABLE t2; +connection server2; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB; INSERT INTO t1 VALUES (1),(2); -save_master_pos; +--source include/show_binlog_events.inc --replace_column 1 <the_epoch2> SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM cluster.binlog_index ORDER BY epoch DESC LIMIT 1; @@ -56,16 +63,14 @@ let $the_epoch2= `SELECT @the_epoch2`; --replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2> eval SELECT inserts,updates,deletes,schemaops FROM - cluster.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2; -drop table t1; + cluster.binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2; -# flush on server2 +# now see that we have the events on the other server connection server2; -SHOW TABLES; +# doing drop table will ensure that all the events have been received +drop table t1; +# verify thar we have table and data in binlog +--source include/show_binlog_events.inc --replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2> eval SELECT inserts,updates,deletes,schemaops FROM - cluster.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2; - -# reset -connection server1; - + cluster.binlog_index WHERE epoch > $the_epoch AND epoch <= $the_epoch2; |