From: magnus.blaudd Date: June 22 2011 9:42am Subject: bzr push into mysql-5.1-telco-7.0 branch (magnus.blaudd:4472 to 4473) List-Archive: http://lists.mysql.com/commits/139672 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4473 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/src/common/portlib/CMakeLists.txt storage/ndb/src/mgmsrv/MgmtSrvr.cpp storage/ndb/tools/ndb_dump_frm_data.cpp 4472 Jonas Oreland 2011-06-22 ndb - bug#12678971 - remove c++ from ndb_logevent.h and friends modified: storage/ndb/include/mgmapi/ndb_logevent.h storage/ndb/include/ndb_types.h.in === 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-16 18:16:01 +0000 +++ b/sql/ha_ndbcluster.h 2011-06-22 08:34:17 +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/src/common/portlib/CMakeLists.txt' --- a/storage/ndb/src/common/portlib/CMakeLists.txt 2011-05-25 06:52:33 +0000 +++ b/storage/ndb/src/common/portlib/CMakeLists.txt 2011-06-22 06:19:13 +0000 @@ -22,7 +22,7 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ IF(WIN32) SET(EXTRA_SRC ${CMAKE_SOURCE_DIR}/sql/nt_servc.cc) ENDIF(WIN32) -ADD_LIBRARY(ndbportlib STATIC +ADD_CONVENIENCE_LIBRARY(ndbportlib NdbCondition.c NdbMutex.c ndb_socket.cpp NdbEnv.c NdbThread.c NdbHost.c NdbTCP.cpp NdbMem.c NdbConfig.c NdbTick.c NdbDir.cpp === modified file 'storage/ndb/src/mgmsrv/MgmtSrvr.cpp' --- a/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2011-06-21 14:12:16 +0000 +++ b/storage/ndb/src/mgmsrv/MgmtSrvr.cpp 2011-06-22 08:57:03 +0000 @@ -881,8 +881,8 @@ MgmtSrvr::sendVersionReq(int v_nodeId, ssig.set(ss, TestOrd::TraceAPI, QMGR, GSN_API_VERSION_REQ, ApiVersionReq::SignalLength); - NodeId nodeId; - int do_send = 1; + NodeId nodeId = 0; + bool do_send = true; while(true) { if (do_send) @@ -898,7 +898,7 @@ MgmtSrvr::sendVersionReq(int v_nodeId, return SEND_OR_RECEIVE_FAILED; } - do_send = 0; + do_send = false; } SimpleSignal *signal = ss.waitFor(); @@ -925,7 +925,7 @@ MgmtSrvr::sendVersionReq(int v_nodeId, const NFCompleteRep * const rep = CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr()); if (rep->failedNodeId == nodeId) - do_send = 1; // retry with other node + do_send = true; // retry with other node continue; } @@ -933,7 +933,7 @@ MgmtSrvr::sendVersionReq(int v_nodeId, const NodeFailRep * const rep = CAST_CONSTPTR(NodeFailRep, signal->getDataPtr()); if (NdbNodeBitmask::get(rep->theNodes,nodeId)) - do_send = 1; // retry with other node + do_send = true; // retry with other node continue; } case GSN_API_REGCONF: === 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: useless for push emails).