summaryrefslogtreecommitdiff
path: root/mysql-test/t/sp-destruct.test
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2010-11-30 18:52:38 +0100
committerJon Olav Hauglid <jon.hauglid@oracle.com>2010-11-30 18:52:38 +0100
commit4836ae6571dd1bbfa1bf655ffff58c829baa9a7d (patch)
treebd6cf48210e66b5715547f3f8db22e3f1a4eaf60 /mysql-test/t/sp-destruct.test
parent747493e3c0cf99ec1d94f7a2f3c384c71706b03f (diff)
downloadmariadb-git-4836ae6571dd1bbfa1bf655ffff58c829baa9a7d.tar.gz
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.
Diffstat (limited to 'mysql-test/t/sp-destruct.test')
-rw-r--r--mysql-test/t/sp-destruct.test27
1 files changed, 27 insertions, 0 deletions
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;