summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 2fe22ea5d43..fe020d36f93 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -3089,11 +3089,13 @@ 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;
+ plugin_ref old_enforced_table_plugin= thd->variables.enforced_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;
+ thd->variables.enforced_table_plugin= NULL;
cleanup_variables(&thd->variables);
thd->variables= global_system_variables;
@@ -3113,12 +3115,14 @@ void plugin_thdvar_init(THD *thd)
intern_plugin_lock(NULL, global_system_variables.tmp_table_plugin);
intern_plugin_unlock(NULL, old_table_plugin);
intern_plugin_unlock(NULL, old_tmp_table_plugin);
+ intern_plugin_unlock(NULL, old_enforced_table_plugin);
mysql_mutex_unlock(&LOCK_plugin);
}
else
{
thd->variables.table_plugin= NULL;
thd->variables.tmp_table_plugin= NULL;
+ thd->variables.enforced_table_plugin= NULL;
}
DBUG_VOID_RETURN;
@@ -3132,7 +3136,8 @@ static void unlock_variables(THD *thd, struct system_variables *vars)
{
intern_plugin_unlock(NULL, vars->table_plugin);
intern_plugin_unlock(NULL, vars->tmp_table_plugin);
- vars->table_plugin= vars->tmp_table_plugin= NULL;
+ intern_plugin_unlock(NULL, vars->enforced_table_plugin);
+ vars->table_plugin= vars->tmp_table_plugin= vars->enforced_table_plugin= NULL;
}
@@ -3170,6 +3175,7 @@ static void cleanup_variables(struct system_variables *vars)
DBUG_ASSERT(vars->table_plugin == NULL);
DBUG_ASSERT(vars->tmp_table_plugin == NULL);
+ DBUG_ASSERT(vars->enforced_table_plugin == NULL);
my_free(vars->dynamic_variables_ptr);
vars->dynamic_variables_ptr= NULL;