Commit 319df4bb authored by unknown's avatar unknown
Browse files

Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1

into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-mysqladmin

parents 283592b7 22b56d23
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