Below is the list of changes that have just been committed into a local
5.1 repository of sven. When sven does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-02-06 20:57:45+01:00, sven@riska.(none) +3 -0
BUG#31168: @@hostname does not replicate
Problem: In mixed and statement mode, a query that refers to a system
variable will use the slave's value when replayed on slave. So if the
value of a system variable is inserted in a table, the slave will differ
from the master.
Fix: mark statements that refer to a system variable as "unsafe", meaning
they will be replicated by row in mixed mode.
mysql-test/suite/rpl/r/rpl_system_variables.result@stripped, 2008-02-06 20:57:44+01:00,
sven@riska.(none) +19 -0
New result file for new test.
mysql-test/suite/rpl/r/rpl_system_variables.result@stripped, 2008-02-06 20:57:44+01:00,
sven@riska.(none) +0 -0
mysql-test/suite/rpl/t/rpl_system_variables.test@stripped, 2008-02-06 20:57:44+01:00,
sven@riska.(none) +16 -0
Added new test case to verify that system variables are replicated
correctly.
mysql-test/suite/rpl/t/rpl_system_variables.test@stripped, 2008-02-06 20:57:44+01:00,
sven@riska.(none) +0 -0
sql/sql_yacc.yy@stripped, 2008-02-06 20:57:44+01:00, sven@riska.(none) +2 -0
Make all statements that refer to a system variable unsafe.
diff -Nrup a/mysql-test/suite/rpl/r/rpl_system_variables.result
b/mysql-test/suite/rpl/r/rpl_system_variables.result
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/rpl/r/rpl_system_variables.result 2008-02-06 20:57:44 +01:00
@@ -0,0 +1,19 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+CREATE TABLE t_int (id int, val int);
+SET @@optimizer_search_depth = 10;
+INSERT INTO t_int VALUES (1, @@optimizer_search_depth);
+SET @@optimizer_search_depth = 20;
+INSERT INTO t_int VALUES (2, @@optimizer_search_depth);
+SELECT * from t_int ORDER BY id;
+id val
+1 10
+2 20
+SELECT * from t_int ORDER BY id;
+id val
+1 10
+2 20
diff -Nrup a/mysql-test/suite/rpl/t/rpl_system_variables.test
b/mysql-test/suite/rpl/t/rpl_system_variables.test
--- /dev/null Wed Dec 31 16:00:00 196900
+++ b/mysql-test/suite/rpl/t/rpl_system_variables.test 2008-02-06 20:57:44 +01:00
@@ -0,0 +1,16 @@
+# Test that queries using system variables are replicated correctly.
+
+source include/master-slave.inc;
+
+connection master;
+CREATE TABLE t_int (id int, val int);
+
+SET @@optimizer_search_depth = 10;
+INSERT INTO t_int VALUES (1, @@optimizer_search_depth);
+SET @@optimizer_search_depth = 20;
+INSERT INTO t_int VALUES (2, @@optimizer_search_depth);
+
+SELECT * from t_int ORDER BY id;
+
+sync_slave_with_master;
+SELECT * from t_int ORDER BY id;
diff -Nrup a/sql/sql_yacc.yy b/sql/sql_yacc.yy
--- a/sql/sql_yacc.yy 2007-11-21 21:09:25 +01:00
+++ b/sql/sql_yacc.yy 2008-02-06 20:57:44 +01:00
@@ -7293,6 +7293,8 @@ variable_aux:
}
if (!($$= get_system_var(YYTHD, $2, $3, $4)))
MYSQL_YYABORT;
+ LEX *lex= Lex;
+ lex->set_stmt_unsafe();
}
;
| Thread |
|---|
| • bk commit into 5.1 tree (sven:1.2683) BUG#31168 | Sven Sandberg | 6 Feb 2008 |