summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-02-26 09:22:48 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-02-26 09:22:48 -0300
commit5dd3b617d447658b6fe373975a24a1437a04af4e (patch)
tree81321b5931ef7c61d9d26c5c4f76f833ab9e1f07 /scripts
parent04f1434781cf459ca98d4f0c385f093d30db3f2e (diff)
downloadmariadb-git-5dd3b617d447658b6fe373975a24a1437a04af4e.tar.gz
Bug#49823: mysql_upgrade fatal error due to general_log / slow_low CSV NULL
The problem was that the CSV storage engine does not support NULL fields, yet in some early 5.1 version the log tables (general_log and slow_log) were created with null fields. On top of this, when altering a CSV table column, all fields of the table must be NOT NULL otherwise the alteration fails. The solution is to ensure that during upgrade all columns of the log tables are NOT NULL.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables_fix.sql21
1 files changed, 19 insertions, 2 deletions
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 4260aee9142..deeb4d4de82 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -221,12 +221,29 @@ ALTER TABLE func
SET @old_log_state = @@global.general_log;
SET GLOBAL general_log = 'OFF';
-ALTER TABLE general_log MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL;
+ALTER TABLE general_log
+ MODIFY event_time TIMESTAMP NOT NULL,
+ MODIFY user_host MEDIUMTEXT NOT NULL,
+ MODIFY thread_id INTEGER NOT NULL,
+ MODIFY server_id INTEGER UNSIGNED NOT NULL,
+ MODIFY command_type VARCHAR(64) NOT NULL,
+ MODIFY argument MEDIUMTEXT NOT NULL;
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 MODIFY COLUMN server_id INTEGER UNSIGNED NOT NULL;
+ALTER TABLE slow_log
+ MODIFY start_time TIMESTAMP NOT NULL,
+ MODIFY user_host MEDIUMTEXT NOT NULL,
+ MODIFY query_time TIME NOT NULL,
+ MODIFY lock_time TIME NOT NULL,
+ MODIFY rows_sent INTEGER NOT NULL,
+ MODIFY rows_examined INTEGER NOT NULL,
+ MODIFY db VARCHAR(512) NOT NULL,
+ MODIFY last_insert_id INTEGER NOT NULL,
+ MODIFY insert_id INTEGER NOT NULL,
+ MODIFY server_id INTEGER UNSIGNED NOT NULL,
+ MODIFY sql_text MEDIUMTEXT NOT NULL;
SET GLOBAL slow_query_log = @old_log_state;
#