summaryrefslogtreecommitdiff
path: root/ndb/include
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-31 06:36:32 +0100
committerunknown <joreland@mysql.com>2004-12-31 06:36:32 +0100
commit5098405248ef944f5ef61052a9ea3baa5885a571 (patch)
treea1d6407a6626529b28b62eaf78d244fe41fa644f /ndb/include
parentaf2a68488bd28479b929c8825af80559b980cef1 (diff)
parent5df5f5c174299fc76e65e8273570f09090b41df5 (diff)
downloadmariadb-git-5098405248ef944f5ef61052a9ea3baa5885a571.tar.gz
merge
BitKeeper/etc/logging_ok: auto-union ndb/docs/wl2077.txt: Auto merged ndb/include/Makefile.am: Auto merged ndb/include/ndbapi/NdbTransaction.hpp: Auto merged ndb/src/common/debugger/EventLogger.cpp: Auto merged ndb/src/common/debugger/signaldata/DictTabInfo.cpp: Auto merged ndb/src/common/logger/Logger.cpp: Auto merged ndb/src/common/mgmcommon/ConfigRetriever.cpp: Auto merged ndb/src/common/util/Makefile.am: Auto merged ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: Auto merged ndb/src/kernel/blocks/dbacc/Makefile.am: Auto merged ndb/src/kernel/main.cpp: Auto merged ndb/src/kernel/blocks/dbdict/Dbdict.cpp: Auto merged ndb/src/kernel/blocks/dbdih/Dbdih.hpp: Auto merged ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Auto merged ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Auto merged ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp: Auto merged ndb/src/kernel/vm/Configuration.cpp: Auto merged ndb/src/kernel/vm/Configuration.hpp: Auto merged ndb/src/mgmapi/mgmapi.cpp: Auto merged ndb/src/mgmsrv/CommandInterpreter.cpp: Auto merged ndb/src/mgmsrv/InitConfigFileParser.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.hpp: Auto merged ndb/src/mgmsrv/Services.cpp: Auto merged ndb/src/mgmsrv/Services.hpp: Auto merged ndb/src/mgmsrv/main.cpp: Auto merged ndb/src/ndbapi/NdbBlob.cpp: Auto merged ndb/src/ndbapi/NdbDictionary.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.cpp: Auto merged ndb/src/ndbapi/NdbDictionaryImpl.hpp: Auto merged ndb/src/ndbapi/NdbOperationExec.cpp: Auto merged ndb/src/ndbapi/NdbReceiver.cpp: Auto merged ndb/src/ndbapi/NdbScanOperation.cpp: Auto merged ndb/src/ndbapi/NdbTransaction.cpp: Auto merged ndb/src/ndbapi/Ndbif.cpp: Auto merged ndb/src/ndbapi/Ndbinit.cpp: Auto merged ndb/src/ndbapi/Ndblist.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.cpp: Auto merged ndb/src/ndbapi/TransporterFacade.hpp: Auto merged ndb/src/ndbapi/ndberror.c: Auto merged ndb/test/ndbapi/Makefile.am: Auto merged ndb/test/ndbapi/testDict.cpp: Auto merged ndb/test/ndbapi/testNdbApi.cpp: Auto merged ndb/test/src/NdbRestarter.cpp: Auto merged ndb/test/tools/Makefile.am: Auto merged ndb/tools/Makefile.am: Auto merged ndb/tools/delete_all.cpp: Auto merged ndb/tools/desc.cpp: Auto merged ndb/tools/select_all.cpp: Auto merged ndb/tools/select_count.cpp: Auto merged scripts/make_win_src_distribution.sh: Auto merged sql/ha_ndbcluster.h: Auto merged
Diffstat (limited to 'ndb/include')
-rw-r--r--ndb/include/debugger/EventLogger.hpp4
-rw-r--r--ndb/include/kernel/LogLevel.hpp12
-rw-r--r--ndb/include/kernel/signaldata/CreateEvnt.hpp8
-rw-r--r--ndb/include/kernel/signaldata/PackedSignal.hpp2
-rw-r--r--ndb/include/kernel/signaldata/SumaImpl.hpp18
-rw-r--r--ndb/include/logger/Logger.hpp2
-rw-r--r--ndb/include/mgmapi/mgmapi.h15
-rw-r--r--ndb/include/mgmapi/mgmapi_config_parameters.h1
-rw-r--r--ndb/include/ndbapi/Ndb.hpp92
-rw-r--r--ndb/include/ndbapi/NdbDictionary.hpp8
-rw-r--r--ndb/include/ndbapi/ndb_cluster_connection.hpp31
-rw-r--r--ndb/include/util/BaseString.hpp10
-rw-r--r--ndb/include/util/ndb_opts.h59
13 files changed, 104 insertions, 158 deletions
diff --git a/ndb/include/debugger/EventLogger.hpp b/ndb/include/debugger/EventLogger.hpp
index 686989089ae..ddf21b79f5f 100644
--- a/ndb/include/debugger/EventLogger.hpp
+++ b/ndb/include/debugger/EventLogger.hpp
@@ -48,6 +48,10 @@ public:
static const EventRepLogLevelMatrix matrix[];
static const Uint32 matrixSize;
+ static int event_lookup(int eventType,
+ LogLevel::EventCategory &cat,
+ Uint32 &threshold,
+ Logger::LoggerLevel &severity);
};
/**
diff --git a/ndb/include/kernel/LogLevel.hpp b/ndb/include/kernel/LogLevel.hpp
index 5981ca4701a..3c2f349e0e1 100644
--- a/ndb/include/kernel/LogLevel.hpp
+++ b/ndb/include/kernel/LogLevel.hpp
@@ -73,7 +73,7 @@ public:
/**
* Note level is valid as 0-15
*/
- void setLogLevel(EventCategory ec, Uint32 level = 7);
+ int setLogLevel(EventCategory ec, Uint32 level = 7);
/**
* Get the loglevel (0-15) for a category
@@ -119,10 +119,14 @@ LogLevel::clear(){
}
inline
-void
+int
LogLevel::setLogLevel(EventCategory ec, Uint32 level){
- assert(ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES);
- logLevelData[ec] = (Uint8)level;
+ if (ec >= 0 && (Uint32) ec < LOGLEVEL_CATEGORIES)
+ {
+ logLevelData[ec] = (Uint8)level;
+ return 0;
+ }
+ return 1;
}
inline
diff --git a/ndb/include/kernel/signaldata/CreateEvnt.hpp b/ndb/include/kernel/signaldata/CreateEvnt.hpp
index 65a07c122a2..e911fa36ce6 100644
--- a/ndb/include/kernel/signaldata/CreateEvnt.hpp
+++ b/ndb/include/kernel/signaldata/CreateEvnt.hpp
@@ -475,14 +475,14 @@ struct CreateEvntRef {
}
};
inline bool CreateEvntRef::isTemporary() const
-{ return (errorCode & CreateEvntRef::Temporary) > 0; };
+{ return (errorCode & CreateEvntRef::Temporary) > 0; }
inline void CreateEvntRef::setTemporary()
-{ errorCode |= CreateEvntRef::Temporary; };
+{ errorCode |= CreateEvntRef::Temporary; }
inline CreateEvntRef::ErrorCode CreateEvntRef::setTemporary(ErrorCode ec)
{ return (CreateEvntRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)CreateEvntRef::Temporary)); }
inline CreateEvntRef::ErrorCode CreateEvntRef::makeTemporary(ErrorCode ec)
{ return (CreateEvntRef::ErrorCode)
- ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); };
+ ( (Uint32) ec | (Uint32)CreateEvntRef::Temporary ); }
#endif
diff --git a/ndb/include/kernel/signaldata/PackedSignal.hpp b/ndb/include/kernel/signaldata/PackedSignal.hpp
index 057bb39b25a..ea0ff6db526 100644
--- a/ndb/include/kernel/signaldata/PackedSignal.hpp
+++ b/ndb/include/kernel/signaldata/PackedSignal.hpp
@@ -38,6 +38,6 @@ class PackedSignal {
};
inline
-Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; };
+Uint32 PackedSignal::getSignalType(Uint32 data) { return data >> 28; }
#endif
diff --git a/ndb/include/kernel/signaldata/SumaImpl.hpp b/ndb/include/kernel/signaldata/SumaImpl.hpp
index 089132cd9aa..89ade067dcd 100644
--- a/ndb/include/kernel/signaldata/SumaImpl.hpp
+++ b/ndb/include/kernel/signaldata/SumaImpl.hpp
@@ -159,12 +159,12 @@ public:
Uint32 subscriberRef;
};
inline bool SubStartRef::isTemporary() const
-{ return (errorCode & SubStartRef::Temporary) > 0; };
+{ return (errorCode & SubStartRef::Temporary) > 0; }
inline void SubStartRef::setTemporary()
-{ errorCode |= SubStartRef::Temporary; };
+{ errorCode |= SubStartRef::Temporary; }
inline SubStartRef::ErrorCode SubStartRef::setTemporary(ErrorCode ec)
{ return (SubStartRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)SubStartRef::Temporary)); }
class SubStartConf {
/**
@@ -239,12 +239,12 @@ public:
};
};
inline bool SubStopRef::isTemporary() const
-{ return (errorCode & SubStopRef::Temporary) > 0; };
+{ return (errorCode & SubStopRef::Temporary) > 0; }
inline void SubStopRef::setTemporary()
-{ errorCode |= SubStopRef::Temporary; };
+{ errorCode |= SubStopRef::Temporary; }
inline SubStopRef::ErrorCode SubStopRef::setTemporary(ErrorCode ec)
{ return (SubStopRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)SubStopRef::Temporary)); }
class SubStopConf {
/**
@@ -515,12 +515,12 @@ public:
};
};
inline bool SubRemoveRef::isTemporary() const
-{ return (err & SubRemoveRef::Temporary) > 0; };
+{ return (err & SubRemoveRef::Temporary) > 0; }
inline void SubRemoveRef::setTemporary()
-{ err |= SubRemoveRef::Temporary; };
+{ err |= SubRemoveRef::Temporary; }
inline SubRemoveRef::ErrorCode SubRemoveRef::setTemporary(ErrorCode ec)
{ return (SubRemoveRef::ErrorCode)
- (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); };
+ (errorCode = ((Uint32) ec | (Uint32)SubRemoveRef::Temporary)); }
class SubRemoveConf {
/**
diff --git a/ndb/include/logger/Logger.hpp b/ndb/include/logger/Logger.hpp
index c6145f2091a..f12297023b7 100644
--- a/ndb/include/logger/Logger.hpp
+++ b/ndb/include/logger/Logger.hpp
@@ -101,7 +101,7 @@ public:
/** The log levels. NOTE: Could not use the name LogLevel since
* it caused conflicts with another class.
*/
- enum LoggerLevel {LL_OFF, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR,
+ enum LoggerLevel {LL_ON, LL_DEBUG, LL_INFO, LL_WARNING, LL_ERROR,
LL_CRITICAL, LL_ALERT, LL_ALL};
/**
diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h
index 7f2baecd757..e067d33e010 100644
--- a/ndb/include/mgmapi/mgmapi.h
+++ b/ndb/include/mgmapi/mgmapi.h
@@ -244,7 +244,9 @@ extern "C" {
* Log severities (used to filter the cluster log)
*/
enum ndb_mgm_clusterlog_level {
- NDB_MGM_CLUSTERLOG_OFF = 0, /*< Cluster log off*/
+ NDB_MGM_ILLEGAL_CLUSTERLOG_LEVEL = -1,
+ /* must range from 0 and up, indexes into an array */
+ NDB_MGM_CLUSTERLOG_ON = 0, /*< Cluster log on*/
NDB_MGM_CLUSTERLOG_DEBUG = 1, /*< Used in NDB Cluster
*< developement
*/
@@ -264,7 +266,8 @@ extern "C" {
*< corrected immediately,
*< such as a corrupted system
*/
- NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities on*/
+ /* must be next number, works as bound in loop */
+ NDB_MGM_CLUSTERLOG_ALL = 7 /*< All severities */
};
/**
@@ -623,12 +626,14 @@ extern "C" {
*
* @param handle NDB management handle.
* @param level A cluster log level to filter.
+ * @param enable set 1=enable 0=disable
* @param reply Reply message.
*
* @return -1 on error.
*/
int ndb_mgm_filter_clusterlog(NdbMgmHandle handle,
enum ndb_mgm_clusterlog_level level,
+ int enable,
struct ndb_mgm_reply* reply);
/**
@@ -702,11 +707,15 @@ extern "C" {
* Start backup
*
* @param handle NDB management handle.
+ * @param wait_completed 0=don't wait for confirmation
+ 1=wait for backup started
+ 2=wait for backup completed
* @param backup_id Backup id is returned from function.
* @param reply Reply message.
* @return -1 on error.
*/
- int ndb_mgm_start_backup(NdbMgmHandle handle, unsigned int* backup_id,
+ int ndb_mgm_start_backup(NdbMgmHandle handle, int wait_completed,
+ unsigned int* backup_id,
struct ndb_mgm_reply* reply);
/**
diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h
index 6a0cd376355..406bdb1a110 100644
--- a/ndb/include/mgmapi/mgmapi_config_parameters.h
+++ b/ndb/include/mgmapi/mgmapi_config_parameters.h
@@ -110,6 +110,7 @@
#define CFG_CONNECTION_SERVER_PORT 406
#define CFG_CONNECTION_HOSTNAME_1 407
#define CFG_CONNECTION_HOSTNAME_2 408
+#define CFG_CONNECTION_GROUP 409
#define CFG_TCP_SERVER 452
#define CFG_TCP_SEND_BUFFER_SIZE 454
diff --git a/ndb/include/ndbapi/Ndb.hpp b/ndb/include/ndbapi/Ndb.hpp
index 44a4b96fecf..30be935b0a2 100644
--- a/ndb/include/ndbapi/Ndb.hpp
+++ b/ndb/include/ndbapi/Ndb.hpp
@@ -954,23 +954,6 @@ typedef void (* NdbEventCallback)(NdbEventOperation*, Ndb*, void*);
NDB_MAX_SCHEMA_NAME_SIZE + \
NDB_MAX_TAB_NAME_SIZE*2
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
-class NdbWaiter {
-public:
- NdbWaiter();
- ~NdbWaiter();
-
- void wait(int waitTime);
- void nodeFail(Uint32 node);
- void signal(Uint32 state);
-
- Uint32 m_node;
- Uint32 m_state;
- void * m_mutex;
- struct NdbCondition * m_condition;
-};
-#endif
-
/**
* @class Ndb
* @brief Represents the NDB kernel and is the main class of the NDB API.
@@ -1233,39 +1216,6 @@ public:
const char * keyData = 0,
Uint32 keyLen = 0);
-#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
- /**
- * This method is a modification of Ndb::startTransaction,
- * in which we use only the first two chars of keyData to
- * select transaction coordinator.
- * This is referred to as a distribution group.
- * There are two ways to use the method:
- * - In the first, the two characters are used directly as
- * the distribution key, and
- * - in the second the distribution is calculated as:
- * (10 * (char[0] - 0x30) + (char[1] - 0x30)).
- * Thus, in the second way, the two ASCII digits '78'
- * will provide the distribution key = 78.
- *
- * @note Transaction priorities are not yet supported.
- *
- * @param aPrio Priority of the transaction.<br>
- * Priority 0 is the highest priority and is used for short transactions
- * with requirements on low delay.<br>
- * Priority 1 is a medium priority for short transactions.<br>
- * Priority 2 is a medium priority for long transactions.<br>
- * Priority 3 is a low priority for long transactions.
- * @param keyData is a string of which the two first characters
- * is used to compute which fragement the data is stored in.
- * @param type is the type of distribution group.<br>
- * 0 means direct usage of the two characters, and<br>
- * 1 means the ASCII digit variant.
- * @return NdbTransaction, or NULL if it failed.
- */
- NdbTransaction* startTransactionDGroup(Uint32 aPrio,
- const char * keyData, int type);
-#endif
-
/**
* Close a transaction.
*
@@ -1622,9 +1572,6 @@ private:
/******************************************************************************
* These are the private variables in this class.
*****************************************************************************/
- NdbObjectIdMap* theNdbObjectIdMap;
- Ndb_cluster_connection *m_ndb_cluster_connection;
-
NdbTransaction** thePreparedTransactionsArray;
NdbTransaction** theSentTransactionsArray;
NdbTransaction** theCompletedTransactionsArray;
@@ -1638,8 +1585,6 @@ private:
Uint32 theNextConnectNode;
- NdbWaiter theWaiter;
-
bool fullyQualifiedNames;
// Ndb database name.
@@ -1673,10 +1618,6 @@ private:
Uint32 theMyRef; // My block reference
Uint32 theNode; // The node number of our node
- Uint32 theNoOfDBnodes; // The number of DB nodes
- Uint32 * theDBnodes; // The node number of the DB nodes
- Uint8 *the_release_ind;// 1 indicates to release all connections to node
-
Uint64 the_last_check_time;
Uint64 theFirstTransId;
@@ -1699,39 +1640,6 @@ private:
InitConfigError
} theInitState;
- // Ensure good distribution of connects
- Uint32 theCurrentConnectIndex;
- Uint32 theCurrentConnectCounter;
-
- /**
- * Computes fragement id for primary key
- *
- * Note that keydata has to be "shaped" as it is being sent in KEYINFO
- */
- Uint32 computeFragmentId(const char * keyData, Uint32 keyLen);
- Uint32 getFragmentId(Uint32 hashValue);
-
- /**
- * Make a guess to which node is the primary for the fragment
- */
- Uint32 guessPrimaryNode(Uint32 fragmentId);
-
- /**
- * Structure containing values for guessing primary node
- */
- struct StartTransactionNodeSelectionData {
- StartTransactionNodeSelectionData():
- fragment2PrimaryNodeMap(0) {};
- Uint32 kValue;
- Uint32 hashValueMask;
- Uint32 hashpointerValue;
- Uint32 noOfFragments;
- Uint32 * fragment2PrimaryNodeMap;
-
- void init(Uint32 noOfNodes, Uint32 nodeIds[]);
- void release();
- } startTransactionNodeSelectionData;
-
NdbApiSignal* theCommitAckSignal;
diff --git a/ndb/include/ndbapi/NdbDictionary.hpp b/ndb/include/ndbapi/NdbDictionary.hpp
index 2e5d70a1a76..6e2e27e95de 100644
--- a/ndb/include/ndbapi/NdbDictionary.hpp
+++ b/ndb/include/ndbapi/NdbDictionary.hpp
@@ -1108,11 +1108,11 @@ public:
int alterTable(const Table &);
/**
- * Get table with given name for alteration.
- * @param name Name of table to alter
- * @return table if successful. NULL if undefined
+ * Get table with given name, NULL if undefined
+ * @param name Name of table to get
+ * @return table if successful otherwise NULL.
*/
- Table getTableForAlteration(const char * name);
+ const Table * getTable(const char * name);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
diff --git a/ndb/include/ndbapi/ndb_cluster_connection.hpp b/ndb/include/ndbapi/ndb_cluster_connection.hpp
index db1cd0b119e..b59d0758a9b 100644
--- a/ndb/include/ndbapi/ndb_cluster_connection.hpp
+++ b/ndb/include/ndbapi/ndb_cluster_connection.hpp
@@ -18,30 +18,33 @@
#ifndef CLUSTER_CONNECTION_HPP
#define CLUSTER_CONNECTION_HPP
-class TransporterFacade;
-class ConfigRetriever;
-struct NdbThread;
-
-extern "C" {
- void* run_ndb_cluster_connection_connect_thread(void*);
-}
-
class Ndb_cluster_connection {
public:
Ndb_cluster_connection(const char * connect_string = 0);
~Ndb_cluster_connection();
int connect(int no_retries, int retry_delay_in_seconds, int verbose);
int start_connect_thread(int (*connect_callback)(void)= 0);
+
+ // add check coupled to init state of cluster connection
+ // timeout_after_first_alive negative - ok only if all alive
+ // timeout_after_first_alive positive - ok if some alive
+ int wait_until_ready(int timeout_for_first_alive,
+ int timeout_after_first_alive);
+
const char *get_connectstring(char *buf, int buf_sz) const;
int get_connected_port() const;
const char *get_connected_host() const;
+
+ void set_optimized_node_selection(int val);
+
+ Uint32 no_db_nodes();
+
private:
- friend void* run_ndb_cluster_connection_connect_thread(void*);
- void connect_thread();
- TransporterFacade *m_facade;
- ConfigRetriever *m_config_retriever;
- NdbThread *m_connect_thread;
- int (*m_connect_callback)(void);
+ friend class Ndb;
+ friend class NdbImpl;
+ friend class Ndb_cluster_connection_impl;
+ class Ndb_cluster_connection_impl & m_impl;
+ Ndb_cluster_connection(Ndb_cluster_connection_impl&);
};
#endif
diff --git a/ndb/include/util/BaseString.hpp b/ndb/include/util/BaseString.hpp
index 066a24f294e..02a6a3b3e66 100644
--- a/ndb/include/util/BaseString.hpp
+++ b/ndb/include/util/BaseString.hpp
@@ -48,10 +48,10 @@ public:
bool empty() const;
/** @brief Convert to uppercase */
- void ndb_toupper();
+ BaseString& ndb_toupper();
/** @brief Convert to lowercase */
- void ndb_tolower();
+ BaseString& ndb_tolower();
/** @brief Assigns from a char * */
BaseString& assign(const char* s);
@@ -206,16 +206,18 @@ BaseString::empty() const
return m_len == 0;
}
-inline void
+inline BaseString&
BaseString::ndb_toupper() {
for(unsigned i = 0; i < length(); i++)
m_chr[i] = toupper(m_chr[i]);
+ return *this;
}
-inline void
+inline BaseString&
BaseString::ndb_tolower() {
for(unsigned i = 0; i < length(); i++)
m_chr[i] = tolower(m_chr[i]);
+ return *this;
}
inline bool
diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h
index f7ae3b5489e..4bac36f5e5e 100644
--- a/ndb/include/util/ndb_opts.h
+++ b/ndb/include/util/ndb_opts.h
@@ -17,47 +17,62 @@
#ifndef _NDB_OPTS_H
#define _NDB_OPTS_H
+#include <ndb_global.h>
#include <my_sys.h>
#include <my_getopt.h>
#include <mysql_version.h>
#include <ndb_version.h>
-#ifndef DBUG_OFF
-#define NDB_STD_OPTS(prog_name) \
- { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
- 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "usage", '?', "Display this help and exit.", \
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "help", '?', "Display this help and exit.", \
- 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "version", 'V', "Output version information and exit.", 0, 0, 0, \
- GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "ndb-connectstring", 'c', \
- "Set connect string for connecting to ndb_mgmd. " \
- "Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
- "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
- { "connect-string", 'c', "same as --ndb-connectstring",\
- (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
- GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
+#define NDB_STD_OPTS_VARS \
+const char *opt_connect_str= 0;\
+my_bool opt_ndb_shm;\
+my_bool opt_ndb_optimized_node_selection
+
+#define NDB_STD_OPTS_OPTIONS \
+OPT_NDB_SHM= 256,\
+OPT_NDB_OPTIMIZED_NODE_SELECTION
+
+#define OPT_NDB_CONNECTSTRING 'c'
+
+#ifdef NDB_SHM_TRANSPORTER
+#define OPT_NDB_SHM_DEFAULT 1
#else
-#define NDB_STD_OPTS(prog_name) \
+#define OPT_NDB_SHM_DEFAULT 0
+#endif
+
+#define NDB_STD_OPTS_COMMON \
{ "usage", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
{ "help", '?', "Display this help and exit.", \
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
{ "version", 'V', "Output version information and exit.", 0, 0, 0, \
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }, \
- { "ndb-connectstring", 'c', \
+ { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \
"Set connect string for connecting to ndb_mgmd. " \
"Syntax: \"[nodeid=<id>;][host=]<hostname>[:<port>]\". " \
"Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\
- { "connect-string", 'c', "same as --ndb-connectstring",\
+ { "ndb-shm", OPT_NDB_SHM,\
+ "Allow optimizing using shared memory connections when available",\
+ (gptr*) &opt_ndb_shm, (gptr*) &opt_ndb_shm, 0,\
+ GET_BOOL, NO_ARG, OPT_NDB_SHM_DEFAULT, 0, 0, 0, 0, 0 },\
+ {"ndb-optimized-node-selection", OPT_NDB_OPTIMIZED_NODE_SELECTION,\
+ "Select nodes for transactions in a more optimal way",\
+ (gptr*) &opt_ndb_optimized_node_selection,\
+ (gptr*) &opt_ndb_optimized_node_selection, 0,\
+ GET_BOOL, OPT_ARG, 1, 0, 0, 0, 0, 0},\
+ { "connect-string", OPT_NDB_CONNECTSTRING, "same as --ndb-connectstring",\
(gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0,\
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }
+
+#ifndef DBUG_OFF
+#define NDB_STD_OPTS(prog_name) \
+ { "debug", '#', "Output debug log. Often this is 'd:t:o,filename'.", \
+ 0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0 }, \
+ NDB_STD_OPTS_COMMON
+#else
+#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
#endif
#endif /*_NDB_OPTS_H */