summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/r/rpl_row_create_table.result
diff options
context:
space:
mode:
authorunknown <mats@mats-laptop.(none)>2008-03-28 13:16:41 +0100
committerunknown <mats@mats-laptop.(none)>2008-03-28 13:16:41 +0100
commitf56d77dadf324d62f21e3fff7f460a8aba464605 (patch)
tree1786746bb6950bf1c6eb7968aa3b51e323573f50 /mysql-test/suite/rpl/r/rpl_row_create_table.result
parent41a80039b62fa8628339cabe264bb4807d4869be (diff)
downloadmariadb-git-f56d77dadf324d62f21e3fff7f460a8aba464605.tar.gz
BUG#29020 (Event results not correctly replicated to slave in RBR):
The bug allow multiple executing transactions working with non-transactional to interfere with each others by interleaving the events of different trans- actions. Bug is fixed by writing non-transactional events to the transaction cache and flushing the cache to the binary log at statement commit. To mimic the behavior of normal statement-based replication, we flush the transaction cache in row- based mode when there is no committed statements in the transaction cache, which means we are committing the first one. This means that it will be written to the binary log as a "mini-transaction" with just the rows for the statement. Note that the changes here does not take effect when building the server with HAVE_TRANSACTIONS set to false, but it is not clear if this was possible before this patch either. For row-based logging, we also have that when AUTOCOMMIT=1, the code now always generates a BEGIN/COMMIT pair for single statements, or BEGIN/ROLLBACK pair in the case of non-transactional changes in a statement that was rolled back. Note that for the case where changes to a non-transactional table causes a rollback due to error, the statement will now be logged with a BEGIN/ROLLBACK pair, even though some changes has been committed to the non-transactional table. mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test: Removing SHOW BINLOG EVENTS causing test to be non-deterministic. mysql-test/r/ctype_cp932_binlog_row.result: Result change. mysql-test/suite/binlog/r/binlog_base64_flag.result: Result change. mysql-test/suite/binlog/r/binlog_multi_engine.result: Result file change. mysql-test/suite/binlog/r/binlog_row_binlog.result: Result file change. mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result: Result file change. mysql-test/suite/binlog/r/binlog_row_insert_select.result: Result file change. mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result: Result file change. mysql-test/suite/binlog/r/binlog_stm_binlog.result: Result file change. mysql-test/suite/binlog/t/binlog_base64_flag.test: Removing table that will be used in test to prevent failing if preceeding tests forgot to drop the table. mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result: Result file change. mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result: Result file change. mysql-test/suite/rpl/r/rpl_row_create_table.result: Result file change. mysql-test/suite/rpl/r/rpl_row_delayed_ins.result: Result file change. mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result: Result file change. mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result: Result file change. mysql-test/suite/rpl/r/rpl_row_log.result: Result file change. mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Result file change. mysql-test/suite/rpl/r/rpl_row_until.result: Result file change. mysql-test/suite/rpl/r/rpl_slave_skip.result: Result file change. mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result: Result file change. mysql-test/suite/rpl/r/rpl_truncate_2myisam.result: Result file change. mysql-test/suite/rpl/t/rpl_row_create_table.test: Binlog position change. mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test: Binlog position change. mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test: Binlog position change. Added stop position to mysqlbinlog argments to prevent extreneous output. mysql-test/suite/rpl/t/rpl_row_until.test: Binlog position change. mysql-test/suite/rpl/t/rpl_slave_skip.test: Binlog position change. mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test: Removing extreneous SHOW BINLOG EVENTS causing test to be non-deterministic. mysql-test/suite/rpl_ndb/r/rpl_ndb_log.result: Result change. sql/log.cc: Adding variable at_least_one_stmt to denote that there is at least one statement committed to the transaction cache (but there might be more). Removing duplicate checks from binlog_end_trans(). The transaction cache should always be committed or rolled back when this function is called. Correcting conditions for binlog_rollback() and binlog_commit() and removing the previous "invisible commit" in favor of always using explicit commits in the binary log. sql/log_event.cc: Marking table map event to be cached. Removing Muted_query_log_event from code. sql/log_event.h: Removing unused class Muted_query_log_event. sql/sql_insert.cc: Adding missing call to ha_autocommit_or_rollback() for delayed thread. Marking CREATE-SELECT statements as transactional, since they don't need to be logged.
Diffstat (limited to 'mysql-test/suite/rpl/r/rpl_row_create_table.result')
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result99
1 files changed, 53 insertions, 46 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index ba5a13a57bf..b846ad09c3b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -140,8 +140,10 @@ a b
SHOW BINLOG EVENTS FROM 1374;
Log_name Pos Event_type Server_id End_log_pos Info
# 1374 Query # 1474 use `test`; CREATE TABLE t7 (a INT, b INT UNIQUE)
-# 1474 Table_map # 1516 table_id: # (test.t7)
-# 1516 Write_rows # 1572 table_id: # flags: STMT_END_F
+# 1474 Query # 1542 use `test`; BEGIN
+# 1542 Table_map # 1584 table_id: # (test.t7)
+# 1584 Write_rows # 1640 table_id: # flags: STMT_END_F
+# 1640 Query # 1711 use `test`; ROLLBACK
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -154,10 +156,12 @@ INSERT INTO t7 SELECT a,b FROM tt4;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
-SHOW BINLOG EVENTS FROM 1572;
+SHOW BINLOG EVENTS FROM 1711;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1572 Table_map # 1614 table_id: # (test.t7)
-# 1614 Write_rows # 1670 table_id: # flags: STMT_END_F
+# 1711 Query # 1779 use `test`; BEGIN
+# 1779 Table_map # 1821 table_id: # (test.t7)
+# 1821 Write_rows # 1877 table_id: # flags: STMT_END_F
+# 1877 Query # 1946 use `test`; COMMIT
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -192,10 +196,10 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-SHOW BINLOG EVENTS FROM 1670;
+SHOW BINLOG EVENTS FROM 1946;
Log_name Pos Event_type Server_id End_log_pos Info
-# 1670 Query # 1756 use `test`; CREATE TABLE t8 LIKE t4
-# 1756 Query # 1895 use `test`; CREATE TABLE `t9` (
+# 1946 Query # 2032 use `test`; CREATE TABLE t8 LIKE t4
+# 2032 Query # 2171 use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
@@ -276,31 +280,35 @@ SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
-# 192 Table_map # 233 table_id: # (test.t1)
-# 233 Write_rows # 277 table_id: # flags: STMT_END_F
-# 277 Query # 345 use `test`; BEGIN
-# 345 Query # 470 use `test`; CREATE TABLE `t2` (
+# 192 Query # 260 use `test`; BEGIN
+# 260 Table_map # 301 table_id: # (test.t1)
+# 301 Write_rows # 345 table_id: # flags: STMT_END_F
+# 345 Query # 414 use `test`; COMMIT
+# 414 Query # 482 use `test`; BEGIN
+# 482 Query # 607 use `test`; CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 470 Table_map # 511 table_id: # (test.t2)
-# 511 Write_rows # 555 table_id: # flags: STMT_END_F
-# 555 Xid # 582 COMMIT /* XID */
-# 582 Query # 650 use `test`; BEGIN
-# 650 Query # 775 use `test`; CREATE TABLE `t3` (
+# 607 Table_map # 648 table_id: # (test.t2)
+# 648 Write_rows # 692 table_id: # flags: STMT_END_F
+# 692 Xid # 719 COMMIT /* XID */
+# 719 Query # 787 use `test`; BEGIN
+# 787 Query # 912 use `test`; CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 775 Table_map # 816 table_id: # (test.t3)
-# 816 Write_rows # 860 table_id: # flags: STMT_END_F
-# 860 Xid # 887 COMMIT /* XID */
-# 887 Query # 955 use `test`; BEGIN
-# 955 Query # 1080 use `test`; CREATE TABLE `t4` (
+# 912 Table_map # 953 table_id: # (test.t3)
+# 953 Write_rows # 997 table_id: # flags: STMT_END_F
+# 997 Xid # 1024 COMMIT /* XID */
+# 1024 Query # 1092 use `test`; BEGIN
+# 1092 Query # 1217 use `test`; CREATE TABLE `t4` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB
-# 1080 Table_map # 1121 table_id: # (test.t4)
-# 1121 Write_rows # 1165 table_id: # flags: STMT_END_F
-# 1165 Xid # 1192 COMMIT /* XID */
-# 1192 Table_map # 1233 table_id: # (test.t1)
-# 1233 Write_rows # 1277 table_id: # flags: STMT_END_F
+# 1217 Table_map # 1258 table_id: # (test.t4)
+# 1258 Write_rows # 1302 table_id: # flags: STMT_END_F
+# 1302 Xid # 1329 COMMIT /* XID */
+# 1329 Query # 1397 use `test`; BEGIN
+# 1397 Table_map # 1438 table_id: # (test.t1)
+# 1438 Write_rows # 1482 table_id: # flags: STMT_END_F
+# 1482 Query # 1551 use `test`; COMMIT
SHOW TABLES;
Tables_in_test
t1
@@ -367,15 +375,17 @@ SHOW BINLOG EVENTS;
Log_name Pos Event_type Server_id End_log_pos Info
# 4 Format_desc # 106 Server ver: #, Binlog ver: #
# 106 Query # 192 use `test`; CREATE TABLE t1 (a INT)
-# 192 Table_map # 233 table_id: # (test.t1)
-# 233 Write_rows # 277 table_id: # flags: STMT_END_F
-# 277 Query # 377 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
-# 377 Query # 445 use `test`; BEGIN
-# 445 Table_map # 486 table_id: # (test.t2)
-# 486 Write_rows # 530 table_id: # flags: STMT_END_F
-# 530 Table_map # 571 table_id: # (test.t2)
-# 571 Write_rows # 610 table_id: # flags: STMT_END_F
-# 610 Xid # 637 COMMIT /* XID */
+# 192 Query # 260 use `test`; BEGIN
+# 260 Table_map # 301 table_id: # (test.t1)
+# 301 Write_rows # 345 table_id: # flags: STMT_END_F
+# 345 Query # 414 use `test`; COMMIT
+# 414 Query # 514 use `test`; CREATE TABLE t2 (a INT) ENGINE=INNODB
+# 514 Query # 582 use `test`; BEGIN
+# 582 Table_map # 623 table_id: # (test.t2)
+# 623 Write_rows # 667 table_id: # flags: STMT_END_F
+# 667 Table_map # 708 table_id: # (test.t2)
+# 708 Write_rows # 747 table_id: # flags: STMT_END_F
+# 747 Xid # 774 COMMIT /* XID */
SELECT * FROM t2 ORDER BY a;
a
1
@@ -396,17 +406,14 @@ Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
SELECT * FROM t2 ORDER BY a;
a
-SHOW BINLOG EVENTS FROM 637;
+SHOW BINLOG EVENTS FROM 949;
Log_name Pos Event_type Server_id End_log_pos Info
-# 637 Query # 705 use `test`; BEGIN
-# 705 Query # 785 use `test`; TRUNCATE TABLE t2
-# 785 Xid # 812 COMMIT /* XID */
-# 812 Query # 880 use `test`; BEGIN
-# 880 Table_map # 921 table_id: # (test.t2)
-# 921 Write_rows # 965 table_id: # flags: STMT_END_F
-# 965 Table_map # 1006 table_id: # (test.t2)
-# 1006 Write_rows # 1045 table_id: # flags: STMT_END_F
-# 1045 Query # 1116 use `test`; ROLLBACK
+# 949 Query # 1017 use `test`; BEGIN
+# 1017 Table_map # 1058 table_id: # (test.t2)
+# 1058 Write_rows # 1102 table_id: # flags: STMT_END_F
+# 1102 Table_map # 1143 table_id: # (test.t2)
+# 1143 Write_rows # 1182 table_id: # flags: STMT_END_F
+# 1182 Query # 1253 use `test`; ROLLBACK
SELECT * FROM t2 ORDER BY a;
a
DROP TABLE t1,t2;