~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/mysqladmin.cc

MergedĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#include <my_pthread.h>                         /* because of signal()  */
21
21
#include <sys/stat.h>
22
22
 
23
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
24
 
#include "../ndb/src/mgmclient/ndb_mgmclient.h"
25
 
#endif
26
 
 
27
23
#define ADMIN_VERSION "8.42"
28
24
#define MAX_MYSQL_VAR 256
29
25
#define SHUTDOWN_DEF_TIMEOUT 3600               /* Wait for shutdown */
43
39
static uint opt_count_iterations= 0, my_end_arg;
44
40
static ulong opt_connect_timeout, opt_shutdown_timeout;
45
41
static char * unix_port=0;
46
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
47
 
static my_bool opt_ndbcluster=0;
48
 
static char *opt_ndb_connectstring=0;
49
 
#endif
50
42
 
51
43
#ifdef HAVE_SMEM
52
44
static char *shared_memory_base_name=0;
100
92
  ADMIN_PING,             ADMIN_EXTENDED_STATUS, ADMIN_FLUSH_STATUS,
101
93
  ADMIN_FLUSH_PRIVILEGES, ADMIN_START_SLAVE,     ADMIN_STOP_SLAVE,
102
94
  ADMIN_FLUSH_THREADS,    ADMIN_OLD_PASSWORD
103
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
104
 
  ,ADMIN_NDB_MGM
105
 
#endif
106
95
};
107
96
static const char *command_names[]= {
108
97
  "create",               "drop",                "shutdown",
113
102
  "ping",                 "extended-status",     "flush-status",
114
103
  "flush-privileges",     "start-slave",         "stop-slave",
115
104
  "flush-threads","old-password",
116
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
117
 
  "ndb-mgm",
118
 
#endif
119
105
  NullS
120
106
};
121
107
 
210
196
  {"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (uchar**) &opt_shutdown_timeout,
211
197
   (uchar**) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
212
198
   SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
213
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
214
 
  {"ndbcluster", OPT_NDBCLUSTER, ""
215
 
   "", (uchar**) &opt_ndbcluster,
216
 
   (uchar**) &opt_ndbcluster, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
217
 
  {"ndb-connectstring", OPT_NDB_CONNECTSTRING, ""
218
 
   "", (uchar**) &opt_ndb_connectstring,
219
 
   (uchar**) &opt_ndb_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
220
 
#endif
221
199
  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
222
200
};
223
201
 
945
923
      }
946
924
      mysql->reconnect=1;       /* Automatic reconnect is default */
947
925
      break;
948
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
949
 
    case ADMIN_NDB_MGM:
950
 
    {
951
 
      if (argc < 2)
952
 
      {
953
 
        my_printf_error(0, "Too few arguments to ndb-mgm", error_flags);
954
 
        return 1;
955
 
      }
956
 
      {
957
 
        Ndb_mgmclient_handle cmd=
958
 
          ndb_mgmclient_handle_create(opt_ndb_connectstring);
959
 
        ndb_mgmclient_execute(cmd, --argc, ++argv);
960
 
        ndb_mgmclient_handle_destroy(cmd);
961
 
      }
962
 
      argc= 0;
963
 
    }
964
 
    break;
965
 
#endif
966
926
    default:
967
927
      my_printf_error(0, "Unknown command: '%-.60s'", error_flags, argv[0]);
968
928
      return 1;