From 4836ae6571dd1bbfa1bf655ffff58c829baa9a7d Mon Sep 17 00:00:00 2001 From: Jon Olav Hauglid Date: Tue, 30 Nov 2010 18:52:38 +0100 Subject: Bug #58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8 The problem was that mysql_upgrade failed because DROP DATABASE refused to drop the 'performance_schema' database when the mysql.proc table definition was made temporarily invalid by dump import. This patch fixes the problem by adding the error resulting from opening a damaged mysq.proc table (ER_CANNOT_LOAD_FROM_TABLE), to the list of errors DROP DATABASE will ignore when trying to lock stored procedures and functions before deletion. This problem was a regression introduced by the patch for Bug#57663. Test case added to sp-destruct.test. --- mysql-test/t/sp-destruct.test | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'mysql-test/t/sp-destruct.test') diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index a5c287e44a8..b4aa9ea1959 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -252,3 +252,30 @@ drop table mysql.proc; --remove_file $MYSQLTEST_VARDIR/tmp/proc.frm --remove_file $MYSQLTEST_VARDIR/tmp/proc.MYD --remove_file $MYSQLTEST_VARDIR/tmp/proc.MYI + + +--echo # +--echo # Bug#58414 mysql_upgrade fails on dump upgrade between 5.1.53 -> 5.5.8 +--echo # + +--disable_warnings +DROP TABLE IF EXISTS proc_backup; +DROP DATABASE IF EXISTS db1; +--enable_warnings + +--echo # Backup the proc table +RENAME TABLE mysql.proc TO proc_backup; +CREATE TABLE mysql.proc LIKE proc_backup; + +CREATE DATABASE db1; +CREATE PROCEDURE db1.p1() SET @foo = 10; + +--echo # Modify a field of the table. +ALTER TABLE mysql.proc MODIFY comment CHAR (32); + +# This should not fail even if mysql.proc is invalid. +DROP DATABASE db1; + +--echo # Restore mysql.proc +DROP TABLE mysql.proc; +RENAME TABLE proc_backup TO mysql.proc; -- cgit v1.2.1 From 4c1eb0c1719004b66187a166ddf0765cb481a927 Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 30 Mar 2011 14:33:53 +0200 Subject: mtr: cleaned up some superfluos global warning suppressions --- mysql-test/t/sp-destruct.test | 1 + 1 file changed, 1 insertion(+) (limited to 'mysql-test/t/sp-destruct.test') diff --git a/mysql-test/t/sp-destruct.test b/mysql-test/t/sp-destruct.test index 720c24b2c24..b006a36b8fd 100644 --- a/mysql-test/t/sp-destruct.test +++ b/mysql-test/t/sp-destruct.test @@ -14,6 +14,7 @@ # Supress warnings written to the log file call mtr.add_suppression("Column count of mysql.proc is wrong. Expected 20, found 19. The table is probably corrupted"); +call mtr.add_suppression("Stored routine .test...bug14233_[123].: invalid value in column mysql.proc"); # Backup proc table let $MYSQLD_DATADIR= `select @@datadir`; -- cgit v1.2.1