summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-01-06 20:42:06 +0100
committerunknown <jimw@mysql.com>2005-01-06 20:42:06 +0100
commit5728b1daa75090b61489ef6cfc408ea53ce1b364 (patch)
treec90651a1b0a307adbd61975a19dc34f0b2cd6701 /scripts
parentc9da387e5f5a55abec08272174cdeb2487cbdeae (diff)
downloadmariadb-git-5728b1daa75090b61489ef6cfc408ea53ce1b364.tar.gz
Make sure all char columns in the mysql.* tables have the proper width in
mysql_fix_privilege_tables.sql, or they may get truncated during conversion to utf8. (Bug #7539) scripts/mysql_fix_privilege_tables.sql: Reset widths of all text fields at the same time as vonersion to utf8 to avoid length changes
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_fix_privilege_tables.sql39
1 files changed, 32 insertions, 7 deletions
diff --git a/scripts/mysql_fix_privilege_tables.sql b/scripts/mysql_fix_privilege_tables.sql
index a60d987f8b5..536b263f7bd 100644
--- a/scripts/mysql_fix_privilege_tables.sql
+++ b/scripts/mysql_fix_privilege_tables.sql
@@ -9,13 +9,38 @@
-- this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
-ALTER TABLE user type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE db type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE host type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE func type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE columns_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE tables_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
-ALTER TABLE user change Password Password char(41) binary not null;
+-- Convert all tables to UTF-8 with binary collation
+-- and reset all char columns to correct width
+ALTER TABLE user
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY User char(16) NOT NULL default '',
+ MODIFY Password char(41) NOT NULL default '',
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE db
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY Db char(64) NOT NULL default '',
+ MODIFY User char(16) NOT NULL default '',
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE host
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY Db char(64) NOT NULL default '',
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE func
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE columns_priv
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY Db char(64) NOT NULL default '',
+ MODIFY User char(16) NOT NULL default '',
+ MODIFY Table_name char(64) NOT NULL default '',
+ MODIFY Column_name char(64) NOT NULL default '',
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+ALTER TABLE tables_priv
+ MODIFY Host char(60) NOT NULL default '',
+ MODIFY Db char(64) NOT NULL default '',
+ MODIFY User char(16) NOT NULL default '',
+ MODIFY Table_name char(64) NOT NULL default '',
+ MODIFY Grantor char(77) NOT NULL default '',
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE user add File_priv enum('N','Y') NOT NULL;
CREATE TABLE IF NOT EXISTS func (
name char(64) binary DEFAULT '' NOT NULL,