From 376090caaad39444784f33895fb9aa072395cd6f Mon Sep 17 00:00:00 2001 From: Georgi Kodinov Date: Fri, 19 Nov 2010 16:35:04 +0200 Subject: Bug #57551: Live upgrade fails between 5.1.52 -> 5.5.7-rc Updated the server to treat a missing mysql.proxies_priv table as empty. Added some grants to make sure tables are correctly opened when they must be opened. Fixed a mysql_upgrade omission not adding rights to root to execute GRANT PROXY on other users. Removed a redundant CREATE TABLE from mysql_system_tables_fix.sql since it's always executed after mysql_system_tables.sql and the first file has CREATE TABLE in it. Added a test case for the above. Fixed error handling code to close the cursor --- scripts/mysql_system_tables_fix.sql | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql index b51e4c6f549..399c42b1b2d 100644 --- a/scripts/mysql_system_tables_fix.sql +++ b/scripts/mysql_system_tables_fix.sql @@ -643,7 +643,14 @@ drop procedure mysql.die; ALTER TABLE user ADD plugin char(60) DEFAULT '' NOT NULL, ADD authentication_string TEXT NOT NULL; ALTER TABLE user MODIFY plugin char(60) DEFAULT '' NOT NULL; -CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(16) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Timestamp timestamp, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; +-- Need to pre-fill mysql.proxies_priv with access for root even when upgrading from +-- older versions + +CREATE TEMPORARY TABLE tmp_proxies_priv LIKE proxies_priv; +INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now()); +INSERT INTO proxies_priv SELECT * FROM tmp_proxies_priv WHERE @had_proxies_priv_table=0; +DROP TABLE tmp_proxies_priv; + # Activate the new, possible modified privilege tables # This should not be needed, but gives us some extra testing that the above -- cgit v1.2.1