summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorunknown <serg@sergbook.mysql.com>2007-04-15 15:47:27 +0200
committerunknown <serg@sergbook.mysql.com>2007-04-15 15:47:27 +0200
commitadd378761542ade65340b9477ed298e9a1677b10 (patch)
tree4d70d7272be7222d34c74f20067114045c5e0253 /sql/sql_plugin.cc
parent18f02e0aeb39f9ef25c9b0cfd126c5694ba21996 (diff)
downloadmariadb-git-add378761542ade65340b9477ed298e9a1677b10.tar.gz
more wl#2936 fixes: removed implicit ha_thd() calls (too error-prone),
fixed an assert crash include/mysql/plugin.h: more wl#2936 fixes: no implicit ha_thd() calls mysql-test/mysql-test-run.pl: don't load system-wide plugins mysql-test/r/partition_innodb.result: fix the test mysql-test/t/partition_innodb.test: fix the test sql/handler.cc: more wl#2936 fixes: no implicit ha_thd() calls sql/handler.h: more wl#2936 fixes: no implicit ha_thd() calls sql/sql_class.cc: more wl#2936 fixes: no implicit ha_thd() calls sql/sql_plugin.cc: more wl#2936 fixes: assert crash storage/innobase/handler/ha_innodb.cc: more wl#2936 fixes: no implicit ha_thd() calls
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index a2c3c2060e7..a72725fae8c 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1323,6 +1323,13 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
table= tables.table;
init_read_record(&read_record_info, new_thd, table, NULL, 1, 0);
table->use_all_columns();
+ /*
+ there're no other threads running yet, so we don't need a mutex.
+ but plugin_add() before is designed to work in multi-threaded
+ environment, and it uses safe_mutex_assert_owner(), so we lock
+ the mutex here to satisfy the assert
+ */
+ pthread_mutex_lock(&LOCK_plugin);
while (!(error= read_record_info.read_record(&read_record_info)))
{
DBUG_PRINT("info", ("init plugin record"));
@@ -1333,11 +1340,12 @@ static void plugin_load(MEM_ROOT *tmp_root, int *argc, char **argv)
LEX_STRING name= {(char *)str_name.ptr(), str_name.length()};
LEX_STRING dl= {(char *)str_dl.ptr(), str_dl.length()};
- free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
if (plugin_add(tmp_root, &name, &dl, argc, argv, REPORT_TO_LOG))
sql_print_warning("Couldn't load plugin named '%s' with soname '%s'.",
str_name.c_ptr(), str_dl.c_ptr());
+ free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
}
+ pthread_mutex_unlock(&LOCK_plugin);
if (error > 0)
sql_print_error(ER(ER_GET_ERRNO), my_errno);
end_read_record(&read_record_info);