mirror of
https://github.com/MariaDB/server.git
synced 2025-10-28 17:15:19 +03:00
Bug #32219: too many hosts in default grant tables 6.0.3
Fix is to remove any references to the current hostname when running mysql_install_db --cross-bootstrap. (The dist-hook make target makes this call, and the resulting data directory is included in the source distribution as win/data/*.) Also, a few other clean-ups to mysql_install_db while there.
This commit is contained in:
parent
003f5640e7
commit
da357f723a
@@ -2,6 +2,12 @@
|
||||
-- The inital data for system tables of MySQL Server
|
||||
--
|
||||
|
||||
-- When setting up a "cross bootstrap" database (e.g., creating data on a Unix
|
||||
-- host which will later be included in a Windows zip file), any lines
|
||||
-- containing "@current_hostname" are filtered out by mysql_install_db.
|
||||
set @current_hostname= @@hostname;
|
||||
|
||||
|
||||
-- Fill "db" table with default grants for anyone to
|
||||
-- access database 'test' and 'test_%' if "db" table didn't exist
|
||||
CREATE TEMPORARY TABLE tmp_db LIKE db;
|
||||
@@ -15,10 +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);
|
||||
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 (@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 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 (@@hostname,'');
|
||||
INSERT INTO tmp_user (host,user) VALUES (@current_hostname,'');
|
||||
INSERT INTO user SELECT * FROM tmp_user WHERE @had_user_table=0;
|
||||
DROP TABLE tmp_user;
|
||||
|
||||
Reference in New Issue
Block a user