From: magnus.blaudd Date: June 22 2011 8:36am Subject: bzr commit into mysql-5.1-telco-7.1 branch (magnus.blaudd:4255) List-Archive: http://lists.mysql.com/commits/139654 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///data0/magnus/mysql/tmp/zCSKCNf841/7.1/ based on revid:magnus.blaudd@stripped 4255 magnus.blaudd@stripped 2011-06-22 [merge] Merge 7.0 -> 7.1 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-21 13:50:33 +0000 +++ b/sql/ha_ndbcluster.cc 2011-06-22 08:36:40 +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-17 07:14:20 +0000 +++ b/sql/ha_ndbcluster.h 2011-06-22 08:36:40 +0000 @@ -45,7 +45,6 @@ class NdbIndexScanOperation; class NdbBlob; class NdbIndexStat; class NdbEventOperation; -class NdbInterpretedCode; class ha_ndbcluster_cond; class Ndb_event_data; @@ -171,7 +170,7 @@ typedef int (* prepare_detect_func) (str const uchar* old_data, const uchar* new_data, const MY_BITMAP* write_set, - NdbInterpretedCode* code); + class NdbInterpretedCode* code); struct st_conflict_fn_def { @@ -191,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; @@ -230,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; @@ -257,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 @@ -845,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)).