mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 13:32:33 +01:00
ddc2569826
Under row-based replication, DELETE FROM will now always be replicated as individual row deletions, while TRUNCATE TABLE will always be replicated as a statement. mysql-test/extra/rpl_tests/rpl_ddl.test: Using --echo instead of SELECT to print message. mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change. mysql-test/r/federated.result: Result change. mysql-test/r/range.result: Result change. mysql-test/r/rpl_sp_effects.result: Result change. mysql-test/r/show_check.result: Result change. mysql-test/r/sp-error.result: Result change. mysql-test/r/sp.result: Result change. mysql-test/r/timezone2.result: Result change. mysql-test/r/trigger-grant.result: Result change. mysql-test/r/type_datetime.result: Result change. mysql-test/r/type_ranges.result: Result change. mysql-test/r/type_timestamp.result: Result change. mysql-test/r/view.result: Result change. mysql-test/t/archive.test: Test contain statements that only works for statement-based logging. mysql-test/t/disabled.def: Disabling test due to reported bug. mysql-test/t/federated.test: Adding ORDER BY clause to SELECT statements mysql-test/t/range.test: Adding ORDER BY clause to SELECT (sub-)statement mysql-test/t/rpl_sp_effects.test: Adding ORDER BY clause to SELECT statement. mysql-test/t/show_check.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/sp-error.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/sp.test: Adding ORDER BY clause to SELECT statement. mysql-test/t/timezone2.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/trigger-grant.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/type_datetime.test: Adding ORDER BY clause to SELECT statement. mysql-test/t/type_ranges.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/type_timestamp.test: Replacing DELETE FROM without WHERE with TRUNCATE TABLE. mysql-test/t/view.test: Adding ORDER BY clause to SELECT statement. sql/sql_class.h: Adding member function to set replication to statement-based. sql/sql_delete.cc: When row-based replication is used, DELETE FROM will always delete the contents of the table row-by-row and not use delete_all_rows(). mysql-test/extra/rpl_tests/rpl_truncate.test: New BitKeeper file ``mysql-test/extra/rpl_tests/rpl_truncate.test'' mysql-test/extra/rpl_tests/rpl_truncate_helper.inc: New BitKeeper file ``mysql-test/extra/rpl_tests/rpl_truncate_helper.inc'' mysql-test/r/rpl_truncate_2myisam.result: New BitKeeper file ``mysql-test/r/rpl_truncate_2myisam.result'' mysql-test/r/rpl_truncate_3innodb.result: New BitKeeper file ``mysql-test/r/rpl_truncate_3innodb.result'' mysql-test/r/rpl_truncate_7ndb.result: New BitKeeper file ``mysql-test/r/rpl_truncate_7ndb.result'' mysql-test/t/rpl_truncate_2myisam.test: New BitKeeper file ``mysql-test/t/rpl_truncate_2myisam.test'' mysql-test/t/rpl_truncate_3innodb.test: New BitKeeper file ``mysql-test/t/rpl_truncate_3innodb.test'' mysql-test/t/rpl_truncate_7ndb.test: New BitKeeper file ``mysql-test/t/rpl_truncate_7ndb.test''
105 lines
3.9 KiB
Text
105 lines
3.9 KiB
Text
stop slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
reset master;
|
|
reset slave;
|
|
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
|
start slave;
|
|
**** On 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;
|
|
a b
|
|
1 1
|
|
2 2
|
|
**** On Slave ****
|
|
INSERT INTO t1 VALUE (3,3);
|
|
SELECT * FROM t1 ORDER BY a,b;
|
|
a b
|
|
1 1
|
|
2 2
|
|
3 3
|
|
**** On Master ****
|
|
TRUNCATE TABLE t1;
|
|
SELECT * FROM t1 ORDER BY a,b;
|
|
a b
|
|
**** On Slave ****
|
|
SELECT * FROM t1 ORDER BY a,b;
|
|
a b
|
|
**** On Master ****
|
|
DROP TABLE t1;
|
|
SHOW BINLOG EVENTS;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 4 Format_desc 1 102 Server ver: 5.1.10-beta-debug-log, Binlog ver: 4
|
|
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
|
|
master-bin.000001 219 Query 1 283 BEGIN
|
|
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
|
|
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status)
|
|
master-bin.000001 376 Write_rows 1 135 table_id: #
|
|
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
|
|
master-bin.000001 465 Query 1 530 COMMIT
|
|
master-bin.000001 530 Query 1 80 use `test`; TRUNCATE TABLE t1
|
|
master-bin.000001 610 Query 1 679 use `test`; COMMIT
|
|
master-bin.000001 679 Query 1 743 BEGIN
|
|
master-bin.000001 743 Table_map 1 40 table_id: # (test.t1)
|
|
master-bin.000001 783 Table_map 1 93 table_id: # (cluster.apply_status)
|
|
master-bin.000001 836 Write_rows 1 135 table_id: #
|
|
master-bin.000001 878 Delete_rows 1 174 table_id: # flags: STMT_END_F
|
|
master-bin.000001 917 Query 1 982 COMMIT
|
|
master-bin.000001 982 Query 1 1058 use `test`; DROP TABLE t1
|
|
**** On 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;
|
|
a b
|
|
1 1
|
|
2 2
|
|
**** On Slave ****
|
|
INSERT INTO t1 VALUE (3,3);
|
|
SELECT * FROM t1 ORDER BY a,b;
|
|
a b
|
|
1 1
|
|
2 2
|
|
3 3
|
|
**** On Master ****
|
|
DELETE FROM t1;
|
|
SELECT * FROM t1 ORDER BY a,b;
|
|
a b
|
|
**** On Slave ****
|
|
SELECT * FROM t1 ORDER BY a,b;
|
|
a b
|
|
3 3
|
|
**** On Master ****
|
|
DROP TABLE t1;
|
|
SHOW BINLOG EVENTS;
|
|
Log_name Pos Event_type Server_id End_log_pos Info
|
|
master-bin.000001 4 Format_desc 1 102 Server ver: 5.1.10-beta-debug-log, Binlog ver: 4
|
|
master-bin.000001 102 Query 1 219 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
|
|
master-bin.000001 219 Query 1 283 BEGIN
|
|
master-bin.000001 283 Table_map 1 40 table_id: # (test.t1)
|
|
master-bin.000001 323 Table_map 1 93 table_id: # (cluster.apply_status)
|
|
master-bin.000001 376 Write_rows 1 135 table_id: #
|
|
master-bin.000001 418 Write_rows 1 182 table_id: # flags: STMT_END_F
|
|
master-bin.000001 465 Query 1 530 COMMIT
|
|
master-bin.000001 530 Query 1 80 use `test`; TRUNCATE TABLE t1
|
|
master-bin.000001 610 Query 1 679 use `test`; COMMIT
|
|
master-bin.000001 679 Query 1 743 BEGIN
|
|
master-bin.000001 743 Table_map 1 40 table_id: # (test.t1)
|
|
master-bin.000001 783 Table_map 1 93 table_id: # (cluster.apply_status)
|
|
master-bin.000001 836 Write_rows 1 135 table_id: #
|
|
master-bin.000001 878 Delete_rows 1 174 table_id: # flags: STMT_END_F
|
|
master-bin.000001 917 Query 1 982 COMMIT
|
|
master-bin.000001 982 Query 1 1058 use `test`; DROP TABLE t1
|
|
master-bin.000001 1058 Query 1 1175 use `test`; CREATE TABLE t1 (a INT PRIMARY KEY, b LONG) ENGINE=NDB
|
|
master-bin.000001 1175 Query 1 1239 BEGIN
|
|
master-bin.000001 1239 Table_map 1 40 table_id: # (test.t1)
|
|
master-bin.000001 1279 Table_map 1 93 table_id: # (cluster.apply_status)
|
|
master-bin.000001 1332 Write_rows 1 135 table_id: #
|
|
master-bin.000001 1374 Write_rows 1 182 table_id: # flags: STMT_END_F
|
|
master-bin.000001 1421 Query 1 1486 COMMIT
|
|
master-bin.000001 1486 Query 1 1550 BEGIN
|
|
master-bin.000001 1550 Table_map 1 40 table_id: # (test.t1)
|
|
master-bin.000001 1590 Table_map 1 93 table_id: # (cluster.apply_status)
|
|
master-bin.000001 1643 Write_rows 1 135 table_id: #
|
|
master-bin.000001 1685 Delete_rows 1 174 table_id: # flags: STMT_END_F
|
|
master-bin.000001 1724 Query 1 1789 COMMIT
|
|
master-bin.000001 1789 Query 1 1865 use `test`; DROP TABLE t1
|