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
a950da3
diff -up mysql-5.5.33/include/mysql.h.p30 mysql-5.5.33/include/mysql.h
a950da3
--- mysql-5.5.33/include/mysql.h.p30	2013-07-15 14:01:50.000000000 +0200
a950da3
+++ mysql-5.5.33/include/mysql.h	2013-08-20 17:26:56.745334059 +0200
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 */
a950da3
diff -up mysql-5.5.33/mysql-test/r/plugin.result.p30 mysql-5.5.33/mysql-test/r/plugin.result
a950da3
--- mysql-5.5.33/mysql-test/r/plugin.result.p30	2013-07-15 14:01:49.000000000 +0200
a950da3
+++ mysql-5.5.33/mysql-test/r/plugin.result	2013-08-20 17:26:56.746334059 +0200
a950da3
@@ -143,3 +143,5 @@ SELECT @@SESSION.example_double_thdvar;
a950da3
 @@SESSION.example_double_thdvar
a950da3
 1000.500000
e8e5360
 UNINSTALL PLUGIN example;
e8e5360
+UNINSTALL PLUGIN MyISAM;
e8e5360
+ERROR HY000: Built-in plugins cannot be deleted
a950da3
diff -up mysql-5.5.33/mysql-test/t/plugin.test.p30 mysql-5.5.33/mysql-test/t/plugin.test
a950da3
--- mysql-5.5.33/mysql-test/t/plugin.test.p30	2013-07-15 14:01:49.000000000 +0200
a950da3
+++ mysql-5.5.33/mysql-test/t/plugin.test	2013-08-20 17:26:56.746334059 +0200
a950da3
@@ -137,3 +137,10 @@ SET SESSION example_double_thdvar = 1000
a950da3
 SELECT @@SESSION.example_double_thdvar;
e8e5360
 
e8e5360
 UNINSTALL PLUGIN example;
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;
e8e5360
+
a950da3
diff -up mysql-5.5.33/sql/share/errmsg-utf8.txt.p30 mysql-5.5.33/sql/share/errmsg-utf8.txt
a950da3
--- mysql-5.5.33/sql/share/errmsg-utf8.txt.p30	2013-07-15 14:01:50.000000000 +0200
a950da3
+++ mysql-5.5.33/sql/share/errmsg-utf8.txt	2013-08-20 17:26:56.750334057 +0200
e8e5360
@@ -6161,7 +6161,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
a950da3
diff -up mysql-5.5.33/sql/sql_plugin.cc.p30 mysql-5.5.33/sql/sql_plugin.cc
a950da3
--- mysql-5.5.33/sql/sql_plugin.cc.p30	2013-08-20 17:26:56.640334104 +0200
a950da3
+++ mysql-5.5.33/sql/sql_plugin.cc	2013-08-20 17:26:56.752334057 +0200
e8e5360
@@ -1909,9 +1909,7 @@ bool mysql_uninstall_plugin(THD *thd, co
e8e5360
   }
e8e5360
   if (!plugin->plugin_dl)
e8e5360
   {
e8e5360
-    push_warning(thd, MYSQL_ERROR::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)