mariadb/mysql-test/extra/rpl_tests/rpl_row_delayed_ins.test
mats@mats-laptop.(none) c8c4500a98 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.
2008-03-28 13:16:41 +01:00

22 lines
596 B
Text

# See if INSERT DELAYED gets replicated
# Only in row-based, as we do SHOW BINLOG EVENTS
-- source include/have_binlog_format_row.inc
-- source include/master-slave.inc
connection master;
let $VERSION=`select version()`;
eval create table t1(a int not null primary key) engine=$engine_type;
insert delayed into t1 values (1);
insert delayed into t1 values (2);
insert delayed into t1 values (3);
flush tables;
SELECT * FROM t1 ORDER BY a;
sync_slave_with_master;
connection master;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
connection master;
drop table t1;
sync_slave_with_master;