mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 14:02:32 +01:00
385ef618e8
The functions ROW_COUNT/FOUND_ROWS are indeed not safe to be used in statement based replication. Added code to declare them as such and switch the statement they're in to row based logging for mixed mode. sql/item_create.cc: Bug #30244: row_count/found_rows does not replicate well - add the functions to the set of "unsafe functions" for statement based replication mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result: BitKeeper file /home/kgeorge/mysql/work/B30244-5.1-opt/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test: BitKeeper file /home/kgeorge/mysql/work/B30244-5.1-opt/mysql-test/suite/rpl/t/rpl_row_unsafe_funcs.test
35 lines
653 B
Text
35 lines
653 B
Text
source include/master-slave.inc;
|
|
source include/have_binlog_format_mixed.inc;
|
|
|
|
#
|
|
# Bug #30244: row_count/found_rows does not replicate well
|
|
#
|
|
|
|
connection master;
|
|
|
|
CREATE TABLE t1 (a INT);
|
|
CREATE TABLE t2 (a INT, b INT);
|
|
|
|
INSERT INTO t1 SELECT 1;
|
|
|
|
connection master1;
|
|
INSERT INTO t1 VALUES (2),(3),(4),(5),(6);
|
|
|
|
connection master;
|
|
INSERT INTO t2 SELECT 1, ROW_COUNT();
|
|
|
|
INSERT INTO t1 VALUES (2),(3),(4);
|
|
INSERT INTO t2 SELECT 2, ROW_COUNT();
|
|
|
|
#must return 1 and 3
|
|
SELECT b FROM t2 ORDER BY a;
|
|
|
|
sync_slave_with_master;
|
|
|
|
#must return 1 and 3
|
|
SELECT b FROM t2 ORDER BY a;
|
|
|
|
connection master;
|
|
DROP TABLE t1, t2;
|
|
sync_slave_with_master;
|
|
connection master;
|