azurit,
I'm not sure we can get away with just a warning, since there is no a good enough workaround for the users. Dumping system tables every time before a minor upgrade doesn't sound like a great idea.
serg,
The problem affects both 5.5 and 10.0. In 10.0, even though we extend the length of the columns at the end of mysql_system_tables_fix.sql, earlier there is an ALTER that truncates them (and hence the data) to 16 symbols. The fix is simple there, we just need to modify the alter to use the correct length.
With 5.5, the only idea I have at the moment is doing it via prepared statements, something like the example below.
Unfortunately, it will have to be done in different places, so it's going to look ugly.
Anyway, if you think that's what we should do (both for 5.5 and 10.0), I can go through the scripts and make the changes, so you don't need to waste time on that.
=== modified file 'scripts/mysql_system_tables_fix.sql'
|
--- scripts/mysql_system_tables_fix.sql 2014-03-17 12:04:28 +0000
|
+++ scripts/mysql_system_tables_fix.sql 2014-04-10 14:21:34 +0000
|
@@ -156,10 +156,20 @@
|
|
# Convert all tables to UTF-8 with binary collation
|
# and reset all char columns to correct width
|
+
|
+SELECT character_maximum_length INTO @col_length FROM INFORMATION_SCHEMA.COLUMNS
|
+ WHERE table_schema = 'mysql' AND table_name = 'user' AND column_name = 'user';
|
+
|
+SET @stmt = CONCAT("
|
ALTER TABLE user
|
MODIFY Host char(60) NOT NULL default '',
|
- MODIFY User char(16) NOT NULL default '',
|
+ MODIFY User char(", @col_length, ") NOT NULL default '',
|
- ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
+ ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin
|
+");
|
+PREPARE stmt FROM @stmt;
|
+EXECUTE stmt;
|
+
|
ALTER TABLE user
|
MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '',
|
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
Hi,
What do you mean by "probably"? What exactly do you observe?