summaryrefslogtreecommitdiff
path: root/ndb/include
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2005-01-28 00:47:41 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2005-01-28 00:47:41 +0100
commitcca25e4d4903fbe1df3cd7251d9519c9c9fa376d (patch)
tree64b7118181c1242daeb2b9816bb749c9f50a9cf2 /ndb/include
parent1c49d54894aec778efa3fef6da5ae992f21b8d1d (diff)
parentdf7bb879cdbbf61e4c879cc6f13126a0be69dff7 (diff)
downloadmariadb-git-cca25e4d4903fbe1df3cd7251d9519c9c9fa376d.tar.gz
Merge
ndb/include/Makefile.am: Auto merged ndb/include/mgmapi/mgmapi_config_parameters.h: Auto merged ndb/src/common/mgmcommon/IPCConfig.cpp: Auto merged ndb/src/common/transporter/TransporterRegistry.cpp: Auto merged ndb/src/kernel/vm/Configuration.cpp: Auto merged ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged ndb/tools/delete_all.cpp: Auto merged ndb/tools/desc.cpp: Auto merged ndb/tools/drop_index.cpp: Auto merged ndb/tools/drop_tab.cpp: Auto merged ndb/tools/listTables.cpp: Auto merged ndb/tools/restore/restore_main.cpp: Auto merged ndb/tools/select_all.cpp: Auto merged ndb/tools/select_count.cpp: Auto merged ndb/tools/waiter.cpp: Auto merged ndb/include/util/ndb_opts.h: SCCS merged ndb/src/mgmsrv/main.cpp: resolved merge conflict
Diffstat (limited to 'ndb/include')
-rw-r--r--ndb/include/Makefile.am1
-rw-r--r--ndb/include/mgmapi/mgmapi_config_parameters.h1
-rw-r--r--ndb/include/ndbapi/ndb_opt_defaults.h27
-rw-r--r--ndb/include/transporter/TransporterDefinitions.hpp1
-rw-r--r--ndb/include/util/ndb_opts.h59
5 files changed, 79 insertions, 10 deletions
diff --git a/ndb/include/Makefile.am b/ndb/include/Makefile.am
index 56d9bbf01fb..10f297492e9 100644
--- a/ndb/include/Makefile.am
+++ b/ndb/include/Makefile.am
@@ -9,6 +9,7 @@ ndb_version.h
ndbapiinclude_HEADERS = \
ndbapi/ndbapi_limits.h \
+ndbapi/ndb_opt_defaults.h \
ndbapi/Ndb.hpp \
ndbapi/NdbApi.hpp \
ndbapi/NdbTransaction.hpp \
diff --git a/ndb/include/mgmapi/mgmapi_config_parameters.h b/ndb/include/mgmapi/mgmapi_config_parameters.h
index 62fa24d3c04..68b63d78fa8 100644
--- a/ndb/include/mgmapi/mgmapi_config_parameters.h
+++ b/ndb/include/mgmapi/mgmapi_config_parameters.h
@@ -121,6 +121,7 @@
#define CFG_SHM_CHECKSUM 501
#define CFG_SHM_KEY 502
#define CFG_SHM_BUFFER_MEM 503
+#define CFG_SHM_SIGNUM 504
#define CFG_SCI_HOST1_ID_0 550
#define CFG_SCI_HOST1_ID_1 551
diff --git a/ndb/include/ndbapi/ndb_opt_defaults.h b/ndb/include/ndbapi/ndb_opt_defaults.h
new file mode 100644
index 00000000000..63b673ed60d
--- /dev/null
+++ b/ndb/include/ndbapi/ndb_opt_defaults.h
@@ -0,0 +1,27 @@
+/* Copyright (C) 2003 MySQL AB
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+
+#ifndef NDB_OPT_DEFAULTS_H
+#define NDB_OPT_DEFAULTS_H
+
+#ifdef SIGRTMIN
+#define OPT_NDB_SHM_SIGNUM_DEFAULT SIGRTMIN+2
+#else
+#define OPT_NDB_SHM_SIGNUM_DEFAULT 0
+#endif
+#define OPT_NDB_SHM_DEFAULT 0
+
+#endif
diff --git a/ndb/include/transporter/TransporterDefinitions.hpp b/ndb/include/transporter/TransporterDefinitions.hpp
index 4ff6b2073eb..d4763ba4c37 100644
--- a/ndb/include/transporter/TransporterDefinitions.hpp
+++ b/ndb/include/transporter/TransporterDefinitions.hpp
@@ -77,6 +77,7 @@ struct SHM_TransporterConfiguration {
Uint32 shmKey;
Uint32 shmSize;
+ int signum;
};
/**
diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h
index 9151aee6cf2..aa7a02f58ae 100644
--- a/ndb/include/util/ndb_opts.h
+++ b/ndb/include/util/ndb_opts.h
@@ -22,24 +22,16 @@
#include <my_getopt.h>
#include <mysql_version.h>
#include <ndb_version.h>
+#include <ndb_opt_defaults.h>
#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
+my_bool opt_ndb_shm;
#define OPT_NDB_CONNECTSTRING 'c'
-#if defined(NOT_ENOUGH_TESTED) && defined(NDB_SHM_TRANSPORTER) && MYSQL_VERSION_ID >= 50000
-#define OPT_NDB_SHM_DEFAULT 1
-#else
-#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 }, \
@@ -75,4 +67,51 @@ OPT_NDB_OPTIMIZED_NODE_SELECTION
#define NDB_STD_OPTS(prog_name) NDB_STD_OPTS_COMMON
#endif
+static void ndb_std_print_version()
+{
+ printf("MySQL distrib %s, for %s (%s)\n",
+ MYSQL_SERVER_VERSION,SYSTEM_TYPE,MACHINE_TYPE);
+}
+
+static void usage();
+
+enum ndb_std_options {
+ OPT_NDB_SHM= 256,
+ OPT_NDB_SHM_SIGNUM,
+ OPT_NDB_OPTIMIZED_NODE_SELECTION,
+ NDB_STD_OPTIONS_LAST /* should always be last in this enum */
+};
+
+static my_bool
+ndb_std_get_one_option(int optid,
+ const struct my_option *opt __attribute__((unused)),
+ const char *argument)
+{
+ switch (optid) {
+ case '#':
+ if (argument)
+ {
+ DBUG_PUSH(argument);
+ }
+ break;
+ case 'V':
+ ndb_std_print_version();
+ exit(0);
+ case '?':
+ usage();
+ exit(0);
+ case OPT_NDB_SHM:
+ if (opt_ndb_shm)
+ {
+#ifndef NDB_SHM_TRANSPORTER
+ printf("Warning: binary not compiled with shared memory support,\n"
+ "Tcp connections will now be used instead\n");
+ opt_ndb_shm= 0;
+#endif
+ }
+ break;
+ }
+ return 0;
+}
+
#endif /*_NDB_OPTS_H */