mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
BUG#49222: Mark RAND() as unsafe
Problem: When RAND() is binlogged in statement mode, the seed is binlogged too, so the replication slave generates the same sequence of random numbers. This makes replication work in many cases, but not in all cases: the order of rows is not guaranteed for, e.g., UPDATE or INSERT...SELECT statements, so the row data will be different if master and slave retrieve the rows in different orders. Fix: Mark RAND() as unsafe. It will generate a warning if binlog_format=STATEMENT and switch to row-logging if binlog_format=ROW.
This commit is contained in:
@@ -4,6 +4,7 @@ reset master;
|
||||
reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
|
||||
create table t1(id int, i int, r1 int, r2 int, p varchar(100));
|
||||
insert into t1 values(1, connection_id(), 0, 0, "");
|
||||
insert into t1 values(2, 0, rand()*1000, rand()*1000, "");
|
||||
|
Reference in New Issue
Block a user