mariadb/mysql-test/t/rpl_truncate_7ndb.test
unknown b58e990c74 Fixed failure with rpl_truncate_7ndb.test when using statement based replication.
is_injective -> table_flag() HA_HAS_OWN_BINLOGGING
(Faster and easier to understand)
Allow cluster_binlogging also in mixed replication mode.


mysql-test/t/rpl_truncate_7ndb.test:
  Ensure that test is only run with mixed or row based replication
sql/ha_ndbcluster.cc:
  Enforce row based replication if a cluster table is used
sql/ha_ndbcluster.h:
  Remove is_injective() (Is now a table flag)
sql/ha_ndbcluster_binlog.cc:
  Use cluster binlogging also in mixed binary logging
  (Using a cluster table will enforce row based replication in mixed mode, so this should be ok)
sql/handler.cc:
  is_injective -> HA_HAS_OWN_BINLOGGING
sql/handler.h:
  is_injective -> HA_HAS_OWN_BINLOGGING
mysql-test/include/have_binlog_format_mixed_or_row.inc:
  New BitKeeper file ``mysql-test/include/have_binlog_format_mixed_or_row.inc''
mysql-test/r/rpl_truncate_7ndb_2.result:
  New BitKeeper file ``mysql-test/r/rpl_truncate_7ndb_2.result''
mysql-test/t/rpl_truncate_7ndb_2-master.opt:
  New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb_2-master.opt''
mysql-test/t/rpl_truncate_7ndb_2.test:
  New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb_2.test''
2006-06-22 22:44:21 +03:00

69 lines
1.7 KiB
Text

--source include/have_ndb.inc
--source include/master-slave.inc
--source include/have_binlog_format_mixed_or_row.inc
--disable_query_log
--disable_warnings
connection slave;
STOP SLAVE;
connection master;
DROP TABLE IF EXISTS t1;
RESET MASTER;
connection slave;
DROP TABLE IF EXISTS t1;
RESET SLAVE;
START SLAVE;
--enable_warnings
--enable_query_log
--echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Slave ****
# This is silly, but NDB doesn't add to the binlog fast enough
--real_sleep 10
sync_slave_with_master;
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Master ****
connection master;
TRUNCATE TABLE t1;
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Slave ****
sync_slave_with_master;
# Should be empty
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Master ****
connection master;
DROP TABLE t1;
--replace_regex /\/\* xid=[0-9]+ \*\//\/* xid= *\// /table_id: [0-9]+/table_id: #/
--replace_result $SERVER_VERSION SERVER_VERSION
SHOW BINLOG EVENTS;
--echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Slave ****
sync_slave_with_master;
INSERT INTO t1 VALUE (3,3);
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Master ****
connection master;
DELETE FROM t1;
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Slave ****
sync_slave_with_master;
# Should be empty
SELECT * FROM t1 ORDER BY a,b;
--echo **** On Master ****
connection master;
DROP TABLE t1;
--replace_regex /table_id: [0-9]+/table_id: #/
--replace_result $SERVER_VERSION SERVER_VERSION
SHOW BINLOG EVENTS;