Commit 5d8b38df authored by Nuno Carvalho's avatar Nuno Carvalho

BUG#11754117 - 45670: INTVAR_EVENTS FOR FILTERED-OUT QUERY_LOG_EVENTS ARE EXECUTED

Improved random number filtering verification on
rpl_filter_tables_not_exist test.
parent 5917c58a
...@@ -114,17 +114,17 @@ id c ...@@ -114,17 +114,17 @@ id c
3 3 3 3
[on master] [on master]
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TABLE test.t1 (a INT); CREATE TABLE test.t1 (a INT);
INSERT INTO test.t1 VALUES(1); INSERT INTO test.t1 VALUES(1);
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
SET INSERT_ID=2; SET INSERT_ID=2;
SET @c=2; SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000; SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); INSERT INTO t5 VALUES (NULL, RAND(), @c);
Warnings: Warnings:
Note 1592 Statement may not be safe to log in statement format. Note 1592 Statement may not be safe to log in statement format.
SELECT b into @b FROM test.t5; SELECT b into @b FROM test.t5;
...@@ -132,6 +132,7 @@ UPDATE test.t1 SET a=2; ...@@ -132,6 +132,7 @@ UPDATE test.t1 SET a=2;
SELECT a AS 'ONE' into @a FROM test.t_slave; SELECT a AS 'ONE' into @a FROM test.t_slave;
SELECT c AS 'NULL' into @c FROM test.t_slave; SELECT c AS 'NULL' into @c FROM test.t_slave;
SELECT b into @b FROM test.t_slave; SELECT b into @b FROM test.t_slave;
include/assert.inc [Random values from master and slave must be different]
drop table test.t5; drop table test.t5;
drop table test.t1; drop table test.t1;
drop table test.t_slave; drop table test.t_slave;
......
...@@ -215,21 +215,23 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; ...@@ -215,21 +215,23 @@ drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
# be filtered as well. # be filtered as well.
# #
connection master; connection master;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # ignored on slave # Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D.
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT); # ignored on slave
CREATE TABLE test.t1 (a INT); # accepted on slave CREATE TABLE test.t1 (a INT); # accepted on slave
INSERT INTO test.t1 VALUES(1); INSERT INTO test.t1 VALUES(1);
--sync_slave_with_master --sync_slave_with_master
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b INT, c INT); # Although RAND() is from 0 to 1.0, DECIMAL(M,D), requires that M must be >= D.
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, ROUND(RAND() * 1000), @c); INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
connection master; connection master;
SET INSERT_ID=2; SET INSERT_ID=2;
SET @c=2; SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000; SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, ROUND(RAND() * 1000), @c); # to be ignored INSERT INTO t5 VALUES (NULL, RAND(), @c); # to be ignored
SELECT b into @b FROM test.t5; SELECT b into @b FROM test.t5;
--let $b_master=`select @b` --let $b_master=`select @b`
UPDATE test.t1 SET a=2; # to run trigger on slave UPDATE test.t1 SET a=2; # to run trigger on slave
...@@ -253,10 +255,9 @@ if (`SELECT @a != 2 and @c != NULL`) ...@@ -253,10 +255,9 @@ if (`SELECT @a != 2 and @c != NULL`)
SELECT b into @b FROM test.t_slave; SELECT b into @b FROM test.t_slave;
--let $b_slave=`select @b` --let $b_slave=`select @b`
if (`SELECT $b_slave = $b_master`) --let $assert_text= Random values from master and slave must be different
{ --let $assert_cond= $b_master != $b_slave
--echo Might be pure coincidence of two randoms from master and slave table. Don not panic yet. --source include/assert.inc
}
# cleanup BUG#11754117 # cleanup BUG#11754117
connection master; connection master;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment