From: magnus.blaudd Date: June 22 2011 8:34am Subject: bzr commit into mysql-5.1-telco-7.0 branch (magnus.blaudd:4474) List-Archive: http://lists.mysql.com/commits/139656 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///data0/magnus/mysql/7.0/ based on revid:magnus.blaudd@stripped 4474 magnus.blaudd@stripped 2011-06-22 [merge] Merge modified: sql/ha_ndb_index_stat.cc sql/ha_ndbcluster.cc sql/ha_ndbcluster.h storage/ndb/tools/ndb_dump_frm_data.cpp === modified file 'sql/ha_ndb_index_stat.cc' --- a/sql/ha_ndb_index_stat.cc 2011-06-16 11:36:45 +0000 +++ b/sql/ha_ndb_index_stat.cc 2011-06-22 07:37:51 +0000 @@ -70,7 +70,7 @@ struct Ndb_index_stat { int lt_old; /* for info only */ struct Ndb_index_stat *list_next; struct Ndb_index_stat *list_prev; - struct st_ndbcluster_share *share; + struct NDB_SHARE *share; Ndb_index_stat(); }; @@ -1585,20 +1585,20 @@ ndb_index_stat_thread_func(void *arg __a /* wait for mysql server to start */ - pthread_mutex_lock(&LOCK_server_started); + mysql_mutex_lock(&LOCK_server_started); while (!mysqld_server_started) { set_timespec(abstime, 1); - pthread_cond_timedwait(&COND_server_started, &LOCK_server_started, - &abstime); + mysql_cond_timedwait(&COND_server_started, &LOCK_server_started, + &abstime); if (ndbcluster_terminating) { - pthread_mutex_unlock(&LOCK_server_started); + mysql_mutex_unlock(&LOCK_server_started); pthread_mutex_lock(&LOCK_ndb_index_stat_thread); goto ndb_index_stat_thread_end; } } - pthread_mutex_unlock(&LOCK_server_started); + mysql_mutex_unlock(&LOCK_server_started); /* Wait for cluster to start @@ -1650,10 +1650,8 @@ ndb_index_stat_thread_func(void *arg __a goto ndb_index_stat_thread_end; pthread_mutex_unlock(&LOCK_ndb_index_stat_thread); - pthread_mutex_lock(&LOCK_global_system_variables); /* const bool enable_ok_new= THDVAR(NULL, index_stat_enable); */ const bool enable_ok_new= ndb_index_stat_get_enable(NULL); - pthread_mutex_unlock(&LOCK_global_system_variables); Ndb_index_stat_proc pr; pr.ndb= thd_ndb->ndb; === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-06-20 12:34:27 +0000 +++ b/sql/ha_ndbcluster.cc 2011-06-22 07:37:51 +0000 @@ -265,7 +265,10 @@ static MYSQL_THDVAR_UINT( */ bool ndb_index_stat_get_enable(THD *thd) { - return THDVAR(thd, index_stat_enable); + mysql_mutex_lock(&LOCK_global_system_variables); + const bool value = THDVAR(thd, index_stat_enable); + mysql_mutex_unlock(&LOCK_global_system_variables); + return value; } /* @@ -11049,7 +11052,7 @@ static int ndbcluster_init(void *p) if (pthread_create(&tmp2, &connection_attrib, ndb_index_stat_thread_func, 0)) { DBUG_PRINT("error", ("Could not create ndb index statistics thread")); - hash_free(&ndbcluster_open_tables); + my_hash_free(&ndbcluster_open_tables); pthread_mutex_destroy(&ndbcluster_mutex); pthread_mutex_destroy(&LOCK_ndb_index_stat_thread); pthread_cond_destroy(&COND_ndb_index_stat_thread); @@ -11070,7 +11073,7 @@ static int ndbcluster_init(void *p) if (!ndb_index_stat_thread_running) { DBUG_PRINT("error", ("ndb index statistics thread exited prematurely")); - hash_free(&ndbcluster_open_tables); + my_hash_free(&ndbcluster_open_tables); pthread_mutex_destroy(&ndbcluster_mutex); pthread_mutex_destroy(&LOCK_ndb_index_stat_thread); pthread_cond_destroy(&COND_ndb_index_stat_thread); === modified file 'sql/ha_ndbcluster.h' --- a/sql/ha_ndbcluster.h 2011-06-22 06:39:41 +0000 +++ b/sql/ha_ndbcluster.h 2011-06-22 08:34:17 +0000 @@ -190,7 +190,7 @@ enum enum_conflict_cause /* NdbOperation custom data which points out handler and record. */ struct Ndb_exceptions_data { - struct st_ndbcluster_share *share; + struct NDB_SHARE* share; const NdbRecord* key_rec; const uchar* row; enum_conflicting_op_type op_type; @@ -229,7 +229,7 @@ struct Ndb_statistics { Uint64 fragment_extent_free_space; }; -typedef struct st_ndbcluster_share { +struct NDB_SHARE { NDB_SHARE_STATE state; MEM_ROOT mem_root; THR_LOCK lock; @@ -256,7 +256,7 @@ typedef struct st_ndbcluster_share { char *old_names; // for rename table MY_BITMAP *subscriber_bitmap; NdbEventOperation *new_op; -} NDB_SHARE; +}; inline NDB_SHARE_STATE @@ -844,7 +844,7 @@ private: key_range *max_key, ha_rows *rows_out); int ndb_index_stat_set_rpk(uint inx); - int ndb_index_stat_wait(Ndb_index_stat *st, + int ndb_index_stat_wait(struct Ndb_index_stat *st, uint sample_version); int ndb_index_stat_query(uint inx, const key_range *min_key, === modified file 'storage/ndb/tools/ndb_dump_frm_data.cpp' --- a/storage/ndb/tools/ndb_dump_frm_data.cpp 2011-06-14 10:42:04 +0000 +++ b/storage/ndb/tools/ndb_dump_frm_data.cpp 2011-06-22 07:57:40 +0000 @@ -20,7 +20,6 @@ #include #include -// UNUSED static int oi = 1000; static struct my_option my_long_options[] = { No bundle (reason: revision is a merge (you can force generation of a bundle with env var BZR_FORCE_BUNDLE=1)).