mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merging into mysql-5.5.16-release.
This commit is contained in:
@@ -539,6 +539,11 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
What's the purpose of this loop? If the goal is to catch a
|
||||
missing 0 record at the end of a list, it will fail miserably
|
||||
since the compiler is likely to optimize this away. /Matz
|
||||
*/
|
||||
for (i= 0;
|
||||
((struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
|
||||
i++)
|
||||
@@ -567,6 +572,23 @@ static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
|
||||
}
|
||||
plugin_dl.plugins= (struct st_mysql_plugin *)sym;
|
||||
|
||||
/*
|
||||
If report is REPORT_TO_USER, we were called from
|
||||
mysql_install_plugin. Otherwise, we are called directly or
|
||||
indirectly from plugin_init.
|
||||
*/
|
||||
if (report == REPORT_TO_USER)
|
||||
{
|
||||
st_mysql_plugin *plugin= plugin_dl.plugins;
|
||||
for ( ; plugin->info ; ++plugin)
|
||||
if (plugin->flags & PLUGIN_OPT_NO_INSTALL)
|
||||
{
|
||||
report_error(report, ER_PLUGIN_NO_INSTALL, plugin->name);
|
||||
free_plugin_mem(&plugin_dl);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Duplicate and convert dll name */
|
||||
plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
|
||||
if (! (plugin_dl.dl.str= (char*) my_malloc(plugin_dl.dl.length, MYF(0))))
|
||||
@@ -1884,6 +1906,16 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name)
|
||||
my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
|
||||
goto err;
|
||||
}
|
||||
/*
|
||||
Error message for ER_PLUGIN_IS_PERMANENT is not suitable for
|
||||
plugins marked as not dynamically uninstallable, so we have a
|
||||
separate one instead of changing the old one.
|
||||
*/
|
||||
if (plugin->plugin->flags & PLUGIN_OPT_NO_UNINSTALL)
|
||||
{
|
||||
my_error(ER_PLUGIN_NO_UNINSTALL, MYF(0), plugin->plugin->name);
|
||||
goto err;
|
||||
}
|
||||
|
||||
plugin->state= PLUGIN_IS_DELETED;
|
||||
if (plugin->ref_count)
|
||||
|
Reference in New Issue
Block a user