diff --git a/sql/mysqld.cc b/sql/mysqld.cc index e92234ddd09..899140f7d71 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -4981,8 +4981,10 @@ a file name for --log-bin-index option", opt_binlog_index_name); } plugins_are_initialized= TRUE; /* Don't separate from init function */ - if (wsrep_check_opts()) - unireg_abort(1); +#ifdef WITH_WSREP + if (WSREP_ON && wsrep_check_opts()) + global_system_variables.wsrep_on= 0; +#endif /* we do want to exit if there are any other unknown options */ if (remaining_argc > 1) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index ea9748c8cb2..c50ddbb5a81 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -3074,12 +3074,12 @@ void plugin_thdvar_init(THD *thd) plugin_ref old_table_plugin= thd->variables.table_plugin; plugin_ref old_tmp_table_plugin= thd->variables.tmp_table_plugin; DBUG_ENTER("plugin_thdvar_init"); - + // This function may be called many times per THD (e.g. on COM_CHANGE_USER) thd->variables.table_plugin= NULL; thd->variables.tmp_table_plugin= NULL; cleanup_variables(thd, &thd->variables); - + thd->variables= global_system_variables; /* we are going to allocate these lazily */ @@ -3098,6 +3098,9 @@ void plugin_thdvar_init(THD *thd) intern_plugin_unlock(NULL, old_table_plugin); intern_plugin_unlock(NULL, old_tmp_table_plugin); mysql_mutex_unlock(&LOCK_plugin); + } else { + thd->variables.table_plugin= NULL; + thd->variables.tmp_table_plugin= NULL; } DBUG_VOID_RETURN;