summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorunknown <bell@desktop.sanja.is.com.ua>2007-12-19 10:13:13 +0200
committerunknown <bell@desktop.sanja.is.com.ua>2007-12-19 10:13:13 +0200
commit46359f4d3059c96425883f2737a333149070522d (patch)
tree61989b99b336e552cb46e3ac1d89e2d6e5c4d274 /sql/sql_plugin.cc
parentee52ff0ad995bfbfbcc670a02c8e8016eda33700 (diff)
downloadmariadb-git-46359f4d3059c96425883f2737a333149070522d.tar.gz
Mutex protection added for loading plugins. (BUG#33345)
sql/sql_plugin.cc: Mutex protection added for loading plugins.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index ef4c63381e2..401e544d4e4 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1421,6 +1421,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv,
#endif
case ';':
name.str[name.length]= '\0';
+ pthread_mutex_lock(&LOCK_plugin);
if (str != &dl) // load all plugins in named module
{
dl= name;
@@ -1444,6 +1445,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv,
if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG))
goto error;
}
+ pthread_mutex_unlock(&LOCK_plugin);
name.length= dl.length= 0;
dl.str= NULL; name.str= p= buffer;
str= &name;
@@ -1463,6 +1465,7 @@ static bool plugin_load_list(MEM_ROOT *tmp_root, int *argc, char **argv,
}
DBUG_RETURN(FALSE);
error:
+ pthread_mutex_unlock(&LOCK_plugin);
sql_print_error("Couldn't load plugin named '%s' with soname '%s'.",
name.str, dl.str);
DBUG_RETURN(TRUE);