Skip to content

Commit

Permalink
Allow {un,}install plugins during bootstrap/skip-grant-tables
Browse files Browse the repository at this point in the history
This aids packagers to install/uninstall plugins without starting a full
mysql instance.

for MDEV-7781.
  • Loading branch information
grooverdan committed Mar 15, 2015
1 parent d61573d commit fd97739
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions sql/sql_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2085,14 +2085,8 @@ bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
char **argv=orig_argv;
DBUG_ENTER("mysql_install_plugin");

if (opt_noacl)
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(TRUE);
}

tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_WRITE);
if (check_table_access(thd, INSERT_ACL, &tables, FALSE, 1, FALSE))
if (!opt_noacl && check_table_access(thd, INSERT_ACL, &tables, FALSE, 1, FALSE))
DBUG_RETURN(TRUE);

/* need to open before acquiring LOCK_plugin or it will deadlock */
Expand Down Expand Up @@ -2227,15 +2221,9 @@ bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name,
bool error= false;
DBUG_ENTER("mysql_uninstall_plugin");

if (opt_noacl)
{
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(TRUE);
}

tables.init_one_table("mysql", 5, "plugin", 6, "plugin", TL_WRITE);

if (check_table_access(thd, DELETE_ACL, &tables, FALSE, 1, FALSE))
if (!opt_noacl && check_table_access(thd, DELETE_ACL, &tables, FALSE, 1, FALSE))
DBUG_RETURN(TRUE);

/* need to open before acquiring LOCK_plugin or it will deadlock */
Expand Down

0 comments on commit fd97739

Please sign in to comment.