Commit 2b146960 authored by unknown's avatar unknown

mysql-test/t/ndb_dd_basic.test

    fixed the test
sql/ha_ndbcluster.cc
    LOCK_plugin is used in ha_ndbcluster.cc
sql/sql_plugin.cc
    LOCK_plugin is used in ha_ndbcluster.cc


mysql-test/t/ndb_dd_basic.test:
  fixed the test
sql/ha_ndbcluster.cc:
  LOCK_plugin is used in ha_ndbcluster.cc
sql/sql_plugin.cc:
  LOCK_plugin is used in ha_ndbcluster.cc
parent 9bafb1a7
...@@ -25,7 +25,6 @@ INITIAL_SIZE 16M ...@@ -25,7 +25,6 @@ INITIAL_SIZE 16M
UNDO_BUFFER_SIZE = 1M UNDO_BUFFER_SIZE = 1M
ENGINE=MYISAM; ENGINE=MYISAM;
--error ER_UNKNOWN_STORAGE_ENGINE
ALTER LOGFILE GROUP lg1 ALTER LOGFILE GROUP lg1
ADD UNDOFILE 'undofile02.dat' ADD UNDOFILE 'undofile02.dat'
INITIAL_SIZE = 4M INITIAL_SIZE = 4M
......
...@@ -6851,6 +6851,7 @@ static int connect_callback() ...@@ -6851,6 +6851,7 @@ static int connect_callback()
} }
extern int ndb_dictionary_is_mysqld; extern int ndb_dictionary_is_mysqld;
extern pthread_mutex_t LOCK_plugin;
static int ndbcluster_init(void *p) static int ndbcluster_init(void *p)
{ {
...@@ -6860,6 +6861,13 @@ static int ndbcluster_init(void *p) ...@@ -6860,6 +6861,13 @@ static int ndbcluster_init(void *p)
if (ndbcluster_inited) if (ndbcluster_inited)
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
/*
Below we create new THD's. They'll need LOCK_plugin, but it's taken now by
plugin initialization code. Release it to avoid deadlocks. It's safe, as
there're no threads that may concurrently access plugin control structures.
*/
pthread_mutex_unlock(&LOCK_plugin);
pthread_mutex_init(&ndbcluster_mutex,MY_MUTEX_INIT_FAST); pthread_mutex_init(&ndbcluster_mutex,MY_MUTEX_INIT_FAST);
pthread_mutex_init(&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST); pthread_mutex_init(&LOCK_ndb_util_thread, MY_MUTEX_INIT_FAST);
pthread_cond_init(&COND_ndb_util_thread, NULL); pthread_cond_init(&COND_ndb_util_thread, NULL);
...@@ -6998,6 +7006,8 @@ static int ndbcluster_init(void *p) ...@@ -6998,6 +7006,8 @@ static int ndbcluster_init(void *p)
goto ndbcluster_init_error; goto ndbcluster_init_error;
} }
pthread_mutex_lock(&LOCK_plugin);
ndbcluster_inited= 1; ndbcluster_inited= 1;
DBUG_RETURN(FALSE); DBUG_RETURN(FALSE);
...@@ -7010,6 +7020,8 @@ static int ndbcluster_init(void *p) ...@@ -7010,6 +7020,8 @@ static int ndbcluster_init(void *p)
g_ndb_cluster_connection= NULL; g_ndb_cluster_connection= NULL;
ndbcluster_hton->state= SHOW_OPTION_DISABLED; // If we couldn't use handler ndbcluster_hton->state= SHOW_OPTION_DISABLED; // If we couldn't use handler
pthread_mutex_lock(&LOCK_plugin);
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
......
...@@ -99,7 +99,7 @@ static bool initialized= 0; ...@@ -99,7 +99,7 @@ static bool initialized= 0;
following variables/structures. following variables/structures.
We are always manipulating ref count, so a rwlock here is unneccessary. We are always manipulating ref count, so a rwlock here is unneccessary.
*/ */
static pthread_mutex_t LOCK_plugin; pthread_mutex_t LOCK_plugin;
static DYNAMIC_ARRAY plugin_dl_array; static DYNAMIC_ARRAY plugin_dl_array;
static DYNAMIC_ARRAY plugin_array; static DYNAMIC_ARRAY plugin_array;
static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM]; static HASH plugin_hash[MYSQL_MAX_PLUGIN_TYPE_NUM];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment