19
19
#include <signal.h>
20
20
#include <my_pthread.h> /* because of signal() */
21
21
#include <sys/stat.h>
24
#ifdef LATER_HAVE_NDBCLUSTER_DB
25
#include "../ndb/src/mgmclient/ndb_mgmclient.h"
28
23
#define ADMIN_VERSION "8.42"
29
24
#define MAX_MYSQL_VAR 256
44
39
static uint opt_count_iterations= 0, my_end_arg;
45
40
static ulong opt_connect_timeout, opt_shutdown_timeout;
46
41
static char * unix_port=0;
47
#ifdef LATER_HAVE_NDBCLUSTER_DB
48
static my_bool opt_ndbcluster=0;
49
static char *opt_ndb_connectstring=0;
53
44
static char *shared_memory_base_name=0;
101
92
ADMIN_PING, ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
102
93
ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE, ADMIN_STOP_SLAVE,
103
94
ADMIN_FLUSH_THREADS, ADMIN_OLD_PASSWORD
104
#ifdef LATER_HAVE_NDBCLUSTER_DB
108
96
static const char *command_names[]= {
109
97
"create", "drop", "shutdown",
114
102
"ping", "extended-status", "flush-status",
115
103
"flush-privileges", "start-slave", "stop-slave",
116
104
"flush-threads","old-password",
117
#ifdef LATER_HAVE_NDBCLUSTER_DB
211
196
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
212
197
(uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
213
198
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
214
#ifdef LATER_HAVE_NDBCLUSTER_DB
215
{"ndbcluster", OPT_NDBCLUSTER, ""
216
"", (uchar**) &opt_ndbcluster,
217
(uchar**) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
218
{"ndb-connectstring", OPT_NDB_CONNECTSTRING, ""
219
"", (uchar**) &opt_ndb_connectstring,
220
(uchar**) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
222
199
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
947
924
mysql->reconnect=1; /* Automatic reconnect is default */
949
#ifdef LATER_HAVE_NDBCLUSTER_DB
954
my_printf_error(0, "Too few arguments to ndb-mgm", error_flags);
958
Ndb_mgmclient_handle cmd=
959
ndb_mgmclient_handle_create(opt_ndb_connectstring);
960
ndb_mgmclient_execute(cmd, --argc, ++argv);
961
ndb_mgmclient_handle_destroy(cmd);
968
927
my_printf_error(0, "Unknown command: '%-.60s'", error_flags, argv[0]);