Blame SOURCES/mysql-pluginerrmsg.patch

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