From: Date: September 23 2008 10:29am Subject: bzr commit into mysql-5.0-bugteam branch (chad:2684) Bug#35754 List-Archive: http://lists.mysql.com/commits/54480 X-Bug: 35754 Message-Id: <20080923082958.1E8D28557C1@calliope.chad.cornsilk.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///Users/cmiller/work/mysqlbzr/5.0-bugteam--bug31167/ 2684 Chad MILLER 2008-09-23 Bug#35754: mysql_install_db does not work if no hostname is set Machines with hostname set to "localhost" cause uniqueness errors in the SQL bootstrap data. Now, insert zero lines for cases where the (lowercased) hostname is the same as an already-inserted 'localhost' name. modified: scripts/mysql_system_tables_data.sql === modified file 'scripts/mysql_system_tables_data.sql' --- a/scripts/mysql_system_tables_data.sql 2007-11-30 05:14:43 +0000 +++ b/scripts/mysql_system_tables_data.sql 2008-09-23 08:28:29 +0000 @@ -21,9 +21,9 @@ 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 (@current_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 SELECT @current_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 WHERE LOWER(@current_hostname) != 'localhost'; 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 tmp_user (host,user) VALUES ('localhost',''); -INSERT INTO tmp_user (host,user) VALUES (@current_hostname,''); +INSERT INTO tmp_user (host,user) SELECT @current_hostname,'' WHERE LOWER(@current_hostname) != 'localhost'; INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0; DROP TABLE tmp_user;