e8e5360
In MySQL 5.5, the InnoDB Plugin is the default version and it's compiled in.
e8e5360
In this case, the plugin cannot be uninstalled and we get error when trying
e8e5360
to do so:
e8e5360
e8e5360
mysql> uninstall plugin innodb;
e8e5360
ERROR 1305 (42000): PLUGIN innodb does not exist
e8e5360
e8e5360
But the error message is misleading. The plugin does exist, it just cannot
e8e5360
be installed because it's not dynamically loaded.
e8e5360
e8e5360
MySQL bug report: http://bugs.mysql.com/bug.php?id=51771
e8e5360
MariaDB bug report: https://mariadb.atlassian.net/browse/MDEV-4573
e8e5360
MariaDB fix: http://bazaar.launchpad.net/~maria-captains/maria/5.5/revision/3802
e8e5360
Bjorn Munch 02226f4
diff --git a/include/mysql.h b/include/mysql.h
Bjorn Munch 02226f4
index 38b54de..0b13e92 100644
Bjorn Munch 02226f4
--- a/include/mysql.h
Bjorn Munch 02226f4
+++ b/include/mysql.h
e8e5360
@@ -134,6 +134,7 @@ typedef unsigned long long my_ulonglong;
e8e5360
 
e8e5360
 /* backward compatibility define - to be removed eventually */
e8e5360
 #define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
e8e5360
+#define WARN_PLUGIN_DELETE_BUILTIN ER_PLUGIN_DELETE_BUILTIN
e8e5360
 
e8e5360
 typedef struct st_mysql_rows {
e8e5360
   struct st_mysql_rows *next;		/* list of rows */
Bjorn Munch 02226f4
diff --git a/mysql-test/r/plugin.result b/mysql-test/r/plugin.result
Bjorn Munch 02226f4
index a3d7437..8ea475d 100644
Bjorn Munch 02226f4
--- a/mysql-test/r/plugin.result
Bjorn Munch 02226f4
+++ b/mysql-test/r/plugin.result
Bjorn Munch 02226f4
@@ -232,3 +232,5 @@ DROP PROCEDURE p_install;
Bjorn Munch 02226f4
 SET DEBUG_SYNC='RESET';
Bjorn Munch 02226f4
 disconnect con1;
Bjorn Munch 02226f4
 disconnect con2;
e8e5360
+UNINSTALL PLUGIN MyISAM;
e8e5360
+ERROR HY000: Built-in plugins cannot be deleted
Bjorn Munch 02226f4
diff --git a/mysql-test/t/plugin.test b/mysql-test/t/plugin.test
Bjorn Munch 02226f4
index de68d36..bf9fb7d 100644
Bjorn Munch 02226f4
--- a/mysql-test/t/plugin.test
Bjorn Munch 02226f4
+++ b/mysql-test/t/plugin.test
Bjorn Munch 02226f4
@@ -277,3 +277,9 @@ disconnect con1;
Bjorn Munch 02226f4
 disconnect con2;
e8e5360
 
Bjorn Munch 02226f4
 --disable_connect_log
e8e5360
+
e8e5360
+#
e8e5360
+# MDEV-4573 UNINSTALL PLUGIN misleading error message for non-dynamic plugins
e8e5360
+#
e8e5360
+--error ER_PLUGIN_DELETE_BUILTIN
e8e5360
+UNINSTALL PLUGIN MyISAM;
Bjorn Munch 02226f4
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
Bjorn Munch 02226f4
index 15acc66..35e2c3c 100644
Bjorn Munch 02226f4
--- a/sql/share/errmsg-utf8.txt
Bjorn Munch 02226f4
+++ b/sql/share/errmsg-utf8.txt
9d8b442
@@ -6235,7 +6235,7 @@ WARN_NO_MASTER_INFO
e8e5360
 WARN_OPTION_IGNORED
e8e5360
   eng "<%-.64s> option ignored"
e8e5360
   ger "Option <%-.64s> ignoriert"
e8e5360
-WARN_PLUGIN_DELETE_BUILTIN
e8e5360
+ER_PLUGIN_DELETE_BUILTIN
e8e5360
   eng "Built-in plugins cannot be deleted"
e8e5360
   ger "Eingebaute Plugins können nicht gelöscht werden"
e8e5360
 WARN_PLUGIN_BUSY
Bjorn Munch 02226f4
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
Bjorn Munch 02226f4
index f134e4f..7e34432 100644
Bjorn Munch 02226f4
--- a/sql/sql_plugin.cc
Bjorn Munch 02226f4
+++ b/sql/sql_plugin.cc
Bjorn Munch 02226f4
@@ -2008,9 +2008,7 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
e8e5360
   }
e8e5360
   if (!plugin->plugin_dl)
e8e5360
   {
9d8b442
-    push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
e8e5360
-                 WARN_PLUGIN_DELETE_BUILTIN, ER(WARN_PLUGIN_DELETE_BUILTIN));
e8e5360
-    my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
e8e5360
+    my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
e8e5360
     goto err;
e8e5360
   }
e8e5360
   if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)