Commit 22b56d23 authored by unknown's avatar unknown
Browse files

changed mysqladmin.c to mysqladmin.cc

    no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
    aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
    removed all dependencies of LocalConfig, except for mgmapi internals
    enabled multiple management servrs to fetch data configurations from eachother


client/Makefile.am:
  changed mysqladmin.c to mysqladmin.cc
client/mysqladmin.cc:
  changed mysqladmin.c to mysqladmin.cc
configure.in:
  no need for dvlags to have DEFINE_CXA_PURE_VIRTUAL anymore
ndb/include/mgmapi/mgmapi.h:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/mgmcommon/ConfigRetriever.hpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/include/ndbapi/ndb_cluster_connection.hpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/main.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/kernel/vm/Configuration.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
  changed to config setting to always use noOfMetaTables to make sure we don't overflow arrays
ndb/src/kernel/vm/Configuration.hpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/LocalConfig.hpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmapi/mgmapi.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/CommandInterpreter.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/main.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.hpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmclient/ndb_mgmclient.h:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvr.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
  enabled multiple management servrs to fetch data configurations from eachother
ndb/src/mgmsrv/MgmtSrvr.hpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/MgmtSrvrConfig.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/mgmsrv/main.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/src/ndbapi/ndb_cluster_connection.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
ndb/tools/waiter.cpp:
  aligned the parsing of connectstring, retries for connect, allocation of nodeid for all cluster nodes
  removed all dependencies of LocalConfig, except for mgmapi internals
parent 55ddbd46
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ bin_PROGRAMS = mysql mysqladmin mysqlcheck mysqlshow \
noinst_HEADERS =		sql_string.h completion_hash.h my_readline.h \
				client_priv.h
mysql_SOURCES =			mysql.cc readline.cc sql_string.cc completion_hash.cc
mysqladmin_SOURCES =		mysqladmin.cc
mysql_LDADD =			@readline_link@ @TERMCAP_LIB@ $(LDADD) $(CXXLDFLAGS)
mysqlbinlog_LDADD =		$(LDADD) $(CXXLDFLAGS)
mysql_DEPENDENCIES=		$(LIBRARIES) $(pkglib_LTLIBRARIES) $(DEPLIB)
+0 −3
Original line number Diff line number Diff line
@@ -1287,9 +1287,6 @@ static my_bool wait_pidfile(char *pidfile, time_t last_modified,
  }
  DBUG_RETURN(error);
}
#ifdef HAVE_NDBCLUSTER_DB
/* lib linked in contains c++ code */
#ifdef __GNUC__
FIX_GCC_LINKING_PROBLEM
#endif
#endif
+0 −1
Original line number Diff line number Diff line
@@ -399,7 +399,6 @@ then
  then
    if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
    then
      CFLAGS="$CFLAGS -DDEFINE_CXA_PURE_VIRTUAL"
      CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL"
    fi
  fi
+22 −8
Original line number Diff line number Diff line
@@ -356,11 +356,28 @@ extern "C" {
  /** 
   * Create a handle to a management server
   *
   * @param   connect_string Connect string to the management server, 
   *
   * @return                 A management handle<br>
   *                         or NULL if no management handle could be created. 
   */
  NdbMgmHandle ndb_mgm_create_handle();
  
  /** 
   * Set connecst string to management server
   *
   * @param   handle         Management handle
   * @param   connect_string Connect string to the management server, 
   *
   * @return                -1 on error.
   */
  int ndb_mgm_set_connectstring(NdbMgmHandle handle,
				const char *connect_string);

  int ndb_mgm_get_configuration_nodeid(NdbMgmHandle handle);
  int ndb_mgm_get_connected_port(NdbMgmHandle handle);
  const char *ndb_mgm_get_connected_host(NdbMgmHandle handle);

  /**
   * Destroy a management server handle
   *
@@ -378,11 +395,10 @@ extern "C" {
   * Connect to a management server
   *
   * @param   handle        Management handle.
   * @param   mgmsrv        Hostname and port of the management server, 
   *                        "hostname:port".
   * @return                -1 on error.
   */
  int ndb_mgm_connect(NdbMgmHandle handle, const char * mgmsrv);
  int ndb_mgm_connect(NdbMgmHandle handle, int no_retries,
		      int retry_delay_in_seconds, int verbose);
  
  /**
   * Disconnect from a management server
@@ -709,9 +725,7 @@ extern "C" {
  void ndb_mgm_destroy_configuration(struct ndb_mgm_configuration *);

  int ndb_mgm_alloc_nodeid(NdbMgmHandle handle,
			   unsigned version,
			   unsigned *pnodeid,
			   int nodetype);
			   unsigned version, int nodetype);
  /**
   * Config iterator
   */
+16 −10
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@
#include <ndb_types.h>
#include <mgmapi.h>
#include <BaseString.hpp>
#include <LocalConfig.hpp>

/**
 * @class ConfigRetriever
@@ -28,10 +27,11 @@
 */
class ConfigRetriever {
public:
  ConfigRetriever(LocalConfig &local_config, Uint32 version, Uint32 nodeType);
  ConfigRetriever(const char * _connect_string,
		  Uint32 version, Uint32 nodeType);
  ~ConfigRetriever();

  int do_connect(int exit_on_connect_failure= false);
  int do_connect(int no_retries, int retry_delay_in_seconds, int verbose);
  
  /**
   * Get configuration for current node.
@@ -46,12 +46,14 @@ public:
   */
  struct ndb_mgm_configuration * getConfig();
  
  void resetError();
  int hasError();
  const char * getErrorString();

  /**
   * @return Node id of this node (as stated in local config or connectString)
   */
  Uint32 allocNodeId();
  Uint32 allocNodeId(int no_retries, int retry_delay_in_seconds);

  /**
   * Get config using socket
@@ -68,22 +70,26 @@ public:
   */
  bool verifyConfig(const struct ndb_mgm_configuration *, Uint32 nodeid);

  Uint32 get_mgmd_port() const {return m_mgmd_port;};
  const char *get_mgmd_host() const {return m_mgmd_host;};
  Uint32 get_mgmd_port() const;
  const char *get_mgmd_host() const;

  Uint32 get_configuration_nodeid() const;
private:
  BaseString errorString;
  enum ErrorType {
    CR_ERROR = 0,
    CR_RETRY = 1
    CR_NO_ERROR = 0,
    CR_ERROR = 1,
    CR_RETRY = 2
  };
  ErrorType latestErrorType;
  
  void setError(ErrorType, const char * errorMsg);
  
  struct LocalConfig&   _localConfig;
  Uint32      _ownNodeId;
  /*
  Uint32      m_mgmd_port;
  const char *m_mgmd_host;
  */

  Uint32 m_version;
  Uint32 m_node_type;
Loading