Bug #12461 | SP's are replicated as stm calls in rbr. RAND() produce diff results on slave | ||
---|---|---|---|
Submitted: | 9 Aug 2005 14:45 | Modified: | 30 Sep 2005 18:37 |
Reporter: | Jonathan Miller | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S1 (Critical) |
Version: | 5.0-wl1012 | OS: | Linux (Linux) |
Assigned to: | Mats Kindahl | CPU Architecture: | Any |
[9 Aug 2005 14:45]
Jonathan Miller
[17 Aug 2005 19:52]
Jonathan Miller
Another example: + create table test.t2 (n MEDIUMINT NOT NULL AUTO_INCREMENT, f FLOAT, d DATETIME, PRIMARY KEY(n)); + create table test.t3 (n MEDIUMINT NOT NULL AUTO_INCREMENT, d DATETIME, PRIMARY KEY(n)); + create trigger test.t2_ai after insert on test.t2 for each row update test.t2 set f=f+3;// + create procedure test.p3() + begin + INSERT INTO test.t3 (d) VALUES (NOW()); + end// + create trigger test.t3_bi_t2 before insert on test.t2 for each row call test.p3()// + create procedure test.p2() + begin + INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW()); + end// + select * from test.t2; + n f d + 1 30.3579 2005-08-17 22:42:13 + 2 27.4394 2005-08-17 22:42:14 + 3 24.1234 2005-08-17 22:42:15 + 4 21.2988 2005-08-17 22:42:16 + 5 18.1236 2005-08-17 22:42:17 + 6 15.7219 2005-08-17 22:42:18 + 7 12.2387 2005-08-17 22:42:19 + 8 9.02777 2005-08-17 22:42:20 + 9 6.4227 2005-08-17 22:42:21 + 10 3.03022 2005-08-17 22:42:22 + select * from test.t3; + n d + 1 2005-08-17 22:42:13 + 2 2005-08-17 22:42:14 + 3 2005-08-17 22:42:15 + 4 2005-08-17 22:42:16 + 5 2005-08-17 22:42:17 + 6 2005-08-17 22:42:18 + 7 2005-08-17 22:42:19 + 8 2005-08-17 22:42:20 + 9 2005-08-17 22:42:21 + 10 2005-08-17 22:42:22 + select * from test.t2; + n f d + 1 30.5827 2005-08-17 22:42:13 + 2 27.1274 2005-08-17 22:42:14 + 3 24.8888 2005-08-17 22:42:15 + 4 21.0617 2005-08-17 22:42:16 + 5 18.6424 2005-08-17 22:42:17 + 6 15.0266 2005-08-17 22:42:18 + 7 12.2057 2005-08-17 22:42:19 + 8 9.94891 2005-08-17 22:42:20 + 9 6.12739 2005-08-17 22:42:21 + 10 3.79025 2005-08-17 22:42:22 + select * from test.t3; + n d + 1 2005-08-17 22:42:13 + 2 2005-08-17 22:42:14 + 3 2005-08-17 22:42:15 + 4 2005-08-17 22:42:16 + 5 2005-08-17 22:42:17 + 6 2005-08-17 22:42:18 + 7 2005-08-17 22:42:19 + 8 2005-08-17 22:42:20 + 9 2005-08-17 22:42:21 + 10 2005-08-17 22:42:22 + + <End test section 2 (Tiggers & SP)> + ----------------------------------- + DROP PROCEDURE test.p2; + DROP TRIGGER test.t2_ai; + DROP TRIGGER test.t3_bi_t2; + DROP TABLE test.t2; + DROP TABLE test.t3;
[18 Aug 2005 15:56]
Jonathan Miller
A Different test case using UUID() + CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a)); + INSERT INTO test.t1 VALUES(1,UUID()); + create procedure test.p1() + begin + INSERT INTO test.t1 VALUES(2,UUID()); + end| + CALL test.p1(); + SELECT * FROM test.t1; + a blob_column + 1 35b204d6-614f-1028-bc79-00e081203f51 + 2 35b27c04-614f-1028-bc79-00e081203f51 + SHOW CREATE TABLE test.t1; + Table Create Table + t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `blob_column` longblob, + PRIMARY KEY (`a`) + ) ENGINE=MyISAM DEFAULT CHARSET=latin1 + SELECT * FROM test.t1; + a blob_column + 1 35b204d6-614f-1028-bc79-00e081203f51 + 2 35b6f4aa-614f-1028-beb8-00e081203f51 + DROP PROCEDURE IF EXISTS test.p1; + DROP TABLE test.t1;
[18 Aug 2005 16:28]
Jonathan Miller
Here is a different test case with USER and CURRENT_USER() + CREATE USER tester IDENTIFIED BY 'test'; + GRANT ALL ON test.* TO 'tester'@'%' IDENTIFIED BY 'test'; + GRANT ALL ON test.* TO ''@'localhost%'; + FLUSH PRIVILEGES; + CREATE TABLE test.t1 (a INT, users VARCHAR(255), PRIMARY KEY(a)); + INSERT INTO test.t1 VALUES(1,USER()); + INSERT INTO test.t1 VALUES(2,CURRENT_USER()); + create procedure test.p1() + begin + INSERT INTO test.t1 VALUES(3,USER()); + INSERT INTO test.t1 VALUES(4,CURRENT_USER()); + end| + CALL test.p1(); + SELECT * FROM test.t1; + a users + 1 tester@localhost + 2 @localhost + 3 tester@localhost + 4 @localhost + SELECT * FROM test.t1; + a users + 1 tester@localhost + 2 @localhost + 3 + 4 @