diff options
author | unknown <guilhem@gbichot2> | 2003-10-02 10:31:37 +0200 |
---|---|---|
committer | unknown <guilhem@gbichot2> | 2003-10-02 10:31:37 +0200 |
commit | 031b6b5fbbde116e6a37b0658a9f090d2e7265ae (patch) | |
tree | 81ba46a9411ef17d25f44f30495eb85c66acf75f /mysql-test/t/rpl_user_variables.test | |
parent | a4f7ed563f68b1fbdc84a897db46777b394740d7 (diff) | |
download | mariadb-git-031b6b5fbbde116e6a37b0658a9f090d2e7265ae.tar.gz |
fix for BUG#1331: "Unexistent user variable is not replicated".
When an update query is to be written to the binlog, and it reads unset
user variables (example: INSERT INTO t VALUEs(@a) where @a does not exist),
we create the variable like if it had been set with SET before, and we loop
(i.e. we redo the steps of logging, now that the variable exists).
mysql-test/r/rpl_user_variables.result:
result update.
mysql-test/t/rpl_user_variables.test:
test to see if unset user variables are written to the binlog
sql/item_func.cc:
When an update query is to be written to the binlog, and it reads unset
user variables (example: INSERT INTO t VALUEs(@a) where @a does not exist),
we create the variable like if it had been set with SET before, and we loop
(i.e. we redo the steps of logging, now that the variable exists).
Diffstat (limited to 'mysql-test/t/rpl_user_variables.test')
-rw-r--r-- | mysql-test/t/rpl_user_variables.test | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test index 7eeccaf64f2..35fbec72ac8 100644 --- a/mysql-test/t/rpl_user_variables.test +++ b/mysql-test/t/rpl_user_variables.test @@ -29,13 +29,16 @@ insert into t1 values (@i1), (@i2), (@i3), (@i4); insert into t1 values (@r1), (@r2); insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5); insert into t1 values (@n1); -insert into t1 values (@n2); +insert into t1 values (@n2); # not explicitely set before insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1); insert into t1 values (@a+(@b:=@a+1)); set @q:='abc'; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')); set @a:=5; insert into t1 values (@a),(@a); +connection master1; # see if variable is reset in binlog when thread changes +insert into t1 values (@a),(@a),(@a*5); +select * from t1; save_master_pos; connection slave; sync_with_master; |