From 909f7607018e644754a2c41b791b44b25a05e8fb Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Mon, 15 Jun 2015 15:37:14 +0400 Subject: MDEV-5309 - RENAME TABLE does not check for existence of the table's engine When RENAME TABLE is executed, it apparently does not check whether the engine is available (unlike ALTER TABLE .. RENAME, which does). It means that if the engine in question was not loaded on some reason, the table might become unusable, since the engine won't know about the change. With this patch RENAME TABLE fails if storage engine is not available. --- mysql-test/r/plugin.result | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/r/plugin.result') diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 630f0141d18..3a2bb32b13d 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -321,3 +321,13 @@ UNUSABLE uninstall soname 'ha_example'; select plugin_name from information_schema.plugins where plugin_library like 'ha_example%'; plugin_name +# +# MDEV-5309 - RENAME TABLE does not check for existence of the table's +# engine +# +INSTALL PLUGIN example SONAME 'ha_example'; +CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +UNINSTALL PLUGIN example; +RENAME TABLE t1 TO t2; +ERROR 42S02: Table 'test.t1' doesn't exist +DROP TABLE t1; -- cgit v1.2.1 From a6087e7dc1ef3561d8189c8db15e9591d0f9b520 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Wed, 17 Jun 2015 16:13:02 +0200 Subject: MDEV-5309 - RENAME TABLE does not check for existence of the table's engine fix the test case for ps-protocol --- mysql-test/r/plugin.result | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mysql-test/r/plugin.result') diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result index 3a2bb32b13d..510c812a30f 100644 --- a/mysql-test/r/plugin.result +++ b/mysql-test/r/plugin.result @@ -327,6 +327,9 @@ plugin_name # INSTALL PLUGIN example SONAME 'ha_example'; CREATE TABLE t1(a INT) ENGINE=EXAMPLE; +SELECT * FROM t1; +a +FLUSH TABLES; UNINSTALL PLUGIN example; RENAME TABLE t1 TO t2; ERROR 42S02: Table 'test.t1' doesn't exist -- cgit v1.2.1