2745 Davi Arnaut 2008-08-05
Bug#33053: mysql_upgrade: Does not convert all mysql db tables from utf8mb3 to utf8
Bug#33002: Event Scheduler: Unnecessarily disabled after 5.1 -> 6.0.4 upgrade
The 3-byte Unicode character set formerly known as utf8 is
now known in 6.0 as utf8mb3 and this cause problems if system
tables created in older versions of MySQL are used as the code
that check table compatibility won't accept a different charset
and this was happening for the event table that wasn't being
properly upgraded.
The solution is to ensure that all system tables are upgraded
to use the new utf8 character set rather than the old utf8mb3.
In the future it would be nice if the server could be capable of
handling the character set mishap, but for now we just upgrade
the table as the event subsystem is the only one that checks
if a table is compatible.
modified:
scripts/mysql_system_tables_fix.sql
2744 Davi Arnaut 2008-08-04
Rename tree back to bugteam after mis-merge.
modified:
.bzr-mysql/default.conf
=== modified file 'scripts/mysql_system_tables_fix.sql'
--- a/scripts/mysql_system_tables_fix.sql 2008-04-29 04:37:22 +0000
+++ b/scripts/mysql_system_tables_fix.sql 2008-08-05 21:36:14 +0000
@@ -216,6 +216,52 @@ ALTER TABLE func
MODIFY type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL;
#
+# Convert miscellaneous tables to UTF-8.
+#
+# Tables coming from a old version might have the 3-byte Unicode
+# character set formerly known as utf8.
+#
+
+ALTER TABLE help_category CONVERT TO CHARACTER SET utf8;
+ALTER TABLE help_keyword CONVERT TO CHARACTER SET utf8;
+ALTER TABLE help_relation CONVERT TO CHARACTER SET utf8;
+ALTER TABLE servers CONVERT TO CHARACTER SET utf8;
+ALTER TABLE time_zone CONVERT TO CHARACTER SET utf8;
+ALTER TABLE time_zone_leap_second CONVERT TO CHARACTER SET utf8;
+ALTER TABLE time_zone_name CONVERT TO CHARACTER SET utf8;
+ALTER TABLE time_zone_transition CONVERT TO CHARACTER SET utf8;
+ALTER TABLE time_zone_transition_type CONVERT TO CHARACTER SET utf8;
+
+# Bug#31291: Avoid conversion from text to mediumtext
+ALTER TABLE help_topic
+ MODIFY description text NOT NULL,
+ MODIFY example text NOT NULL,
+CONVERT TO CHARACTER SET utf8;
+
+#
+# Convert log tables to UTF-8.
+#
+
+SET @old_log_state = @@global.general_log;
+SET GLOBAL general_log = 'OFF';
+ALTER TABLE general_log CONVERT TO CHARACTER SET utf8;
+SET GLOBAL general_log = @old_log_state;
+
+SET @old_log_state = @@global.slow_query_log;
+SET GLOBAL slow_query_log = 'OFF';
+ALTER TABLE slow_log CONVERT TO CHARACTER SET utf8;
+SET GLOBAL slow_query_log = @old_log_state;
+
+#
+# Convert plugin table to UTF-8 with binary collation.
+#
+
+ALTER TABLE plugin
+ MODIFY name char(64) COLLATE utf8_bin NOT NULL DEFAULT '',
+ MODIFY dl char(128) COLLATE utf8_bin NOT NULL DEFAULT '',
+ CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
+
+#
# Detect whether we had Create_view_priv
#
SET @hadCreateViewPriv:=0;
@@ -431,6 +477,13 @@ ALTER TABLE db MODIFY Event_priv enum('N
#
# EVENT table
#
+
+#
+# WARNING: Beware that some columns are added and modified multiple
+# times. Whether adding or modifying the column, it's specification
+# should always be the same.
+#
+
ALTER TABLE event DROP PRIMARY KEY;
ALTER TABLE event ADD PRIMARY KEY(db, name);
# Add sql_mode column just in case.
@@ -499,6 +552,20 @@ ALTER TABLE event ADD body_utf8 longblob
AFTER db_collation;
ALTER TABLE event MODIFY body_utf8 longblob DEFAULT NULL;
+#
+# Convert event table to UTF-8 with binary collation.
+#
+
+ALTER TABLE event
+ CONVERT TO CHARACTER SET utf8;
+ALTER TABLE event
+ MODIFY time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM',
+ MODIFY db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ MODIFY definer char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ MODIFY comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
+ MODIFY character_set_client char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ MODIFY collation_connection char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
+ MODIFY db_collation char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL;
#
# TRIGGER privilege
| Thread |
|---|
| • bzr push into mysql-6.0-bugteam branch (davi:2744 to 2745) Bug#33002Bug#33053 | Davi Arnaut | 6 Aug |