Commit a7962ea5 authored by Elena Stepanova's avatar Elena Stepanova

MDEV-6068 Upgrade removes all changes to 'mysql' database

10.0 variation of the problem was that system tables were altered
during mysql_upgrade process using old (smaller) column lengths. 
At the end the tables were altered again, so the structure was restored,
but if there were long values before the upgrade, they were truncated.
Fixed by using correct column length in alter statements.
parent 5fffa449
...@@ -62,9 +62,9 @@ ALTER TABLE tables_priv ...@@ -62,9 +62,9 @@ ALTER TABLE tables_priv
ALTER TABLE tables_priv ALTER TABLE tables_priv
MODIFY Host char(60) NOT NULL default '', MODIFY Host char(60) NOT NULL default '',
MODIFY Db char(64) NOT NULL default '', MODIFY Db char(64) NOT NULL default '',
MODIFY User char(16) NOT NULL default '', MODIFY User char(80) NOT NULL default '',
MODIFY Table_name char(64) NOT NULL default '', MODIFY Table_name char(64) NOT NULL default '',
MODIFY Grantor char(77) NOT NULL default '', MODIFY Grantor char(141) NOT NULL default '',
ENGINE=MyISAM, ENGINE=MyISAM,
CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
...@@ -90,7 +90,7 @@ ALTER TABLE columns_priv ...@@ -90,7 +90,7 @@ ALTER TABLE columns_priv
ALTER TABLE columns_priv ALTER TABLE columns_priv
MODIFY Host char(60) NOT NULL default '', MODIFY Host char(60) NOT NULL default '',
MODIFY Db char(64) NOT NULL default '', MODIFY Db char(64) NOT NULL default '',
MODIFY User char(16) NOT NULL default '', MODIFY User char(80) NOT NULL default '',
MODIFY Table_name char(64) NOT NULL default '', MODIFY Table_name char(64) NOT NULL default '',
MODIFY Column_name char(64) NOT NULL default '', MODIFY Column_name char(64) NOT NULL default '',
ENGINE=MyISAM, ENGINE=MyISAM,
...@@ -161,7 +161,7 @@ alter table func comment='User defined functions'; ...@@ -161,7 +161,7 @@ alter table func comment='User defined functions';
# and reset all char columns to correct width # and reset all char columns to correct width
ALTER TABLE user ALTER TABLE user
MODIFY Host char(60) NOT NULL default '', MODIFY Host char(60) NOT NULL default '',
MODIFY User char(16) NOT NULL default '', MODIFY User char(80) NOT NULL default '',
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE user ALTER TABLE user
MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '', MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '',
...@@ -191,7 +191,7 @@ ALTER TABLE user ...@@ -191,7 +191,7 @@ ALTER TABLE user
ALTER TABLE db ALTER TABLE db
MODIFY Host char(60) NOT NULL default '', MODIFY Host char(60) NOT NULL default '',
MODIFY Db char(64) NOT NULL default '', MODIFY Db char(64) NOT NULL default '',
MODIFY User char(16) NOT NULL default '', MODIFY User char(80) NOT NULL default '',
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE db ALTER TABLE db
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
...@@ -449,7 +449,7 @@ ALTER TABLE proc CONVERT TO CHARACTER SET utf8; ...@@ -449,7 +449,7 @@ ALTER TABLE proc CONVERT TO CHARACTER SET utf8;
ALTER TABLE proc MODIFY db ALTER TABLE proc MODIFY db
char(64) collate utf8_bin DEFAULT '' NOT NULL, char(64) collate utf8_bin DEFAULT '' NOT NULL,
MODIFY definer MODIFY definer
char(77) collate utf8_bin DEFAULT '' NOT NULL, char(141) collate utf8_bin DEFAULT '' NOT NULL,
MODIFY comment MODIFY comment
char(64) collate utf8_bin DEFAULT '' NOT NULL; char(64) collate utf8_bin DEFAULT '' NOT NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment