From e068e99cd0f7cc64c999c81f546daa9337402a8e Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Wed, 26 Sep 2007 17:04:41 +0200 Subject: [PATCH] Bug#31167 Introduction of @@hostname breaks replication in a ring - Use a local uservariable to avoid @@hostname in binlog --- scripts/mysql_system_tables_data.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/mysql_system_tables_data.sql b/scripts/mysql_system_tables_data.sql index 5f0289ab197..8399ae796ef 100644 --- a/scripts/mysql_system_tables_data.sql +++ b/scripts/mysql_system_tables_data.sql @@ -15,7 +15,8 @@ DROP TABLE tmp_db; -- from local machine if "users" table didn't exist before CREATE TEMPORARY TABLE tmp_user LIKE user; INSERT INTO tmp_user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); -REPLACE INTO tmp_user VALUES (@@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); +set @hostname= @@hostname; +REPLACE INTO tmp_user VALUES (@hostname,'root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); REPLACE INTO tmp_user VALUES ('127.0.0.1','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0); INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user;