mirror of
https://github.com/MariaDB/server.git
synced 2025-06-12 01:53:02 +03:00
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: Load @@hostname into a local user variable to avoid writing @@hostname to the binary log that potentially would be replicated to a slave server that not yet was upgraded to have @@hostname.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user