1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2020-07-31 13:51:28 +03:00
73 changed files with 880 additions and 349 deletions

View File

@ -2240,26 +2240,30 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
if (!(plugin= plugin_find_internal(name, MYSQL_ANY_PLUGIN)) ||
plugin->state & (PLUGIN_IS_UNINITIALIZED | PLUGIN_IS_DYING))
{
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
return 1;
}
if (!plugin->plugin_dl)
{
my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
return 1;
}
if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
{
my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
return 1;
// maybe plugin is in mysql.plugin present so postpond the error
plugin= NULL;
}
plugin->state= PLUGIN_IS_DELETED;
if (plugin->ref_count)
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
else
reap_needed= true;
if (plugin)
{
if (!plugin->plugin_dl)
{
my_error(ER_PLUGIN_DELETE_BUILTIN, MYF(0));
return 1;
}
if (plugin->load_option == PLUGIN_FORCE_PLUS_PERMANENT)
{
my_error(ER_PLUGIN_IS_PERMANENT, MYF(0), name->str);
return 1;
}
plugin->state= PLUGIN_IS_DELETED;
if (plugin->ref_count)
push_warning(thd, Sql_condition::WARN_LEVEL_WARN,
WARN_PLUGIN_BUSY, ER_THD(thd, WARN_PLUGIN_BUSY));
else
reap_needed= true;
}
uchar user_key[MAX_KEY_LENGTH];
table->use_all_columns();
@ -2284,6 +2288,11 @@ static bool do_uninstall(THD *thd, TABLE *table, const LEX_CSTRING *name)
return 1;
}
}
else if (!plugin)
{
my_error(ER_SP_DOES_NOT_EXIST, MYF(0), "PLUGIN", name->str);
return 1;
}
return 0;
}