summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-11-19 16:35:04 +0200
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2010-11-19 16:35:04 +0200
commit376090caaad39444784f33895fb9aa072395cd6f (patch)
tree34ee83260ea7cc0534cfc1a9ad802b0703ee14bb /scripts
parentf4586f488e38880ddd28e78064b10e7efdcce835 (diff)
downloadmariadb-git-376090caaad39444784f33895fb9aa072395cd6f.tar.gz
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables_fix.sql9
1 files changed, 8 insertions, 1 deletions
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