~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/mysqladmin.cc

Merge from trunk 

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <signal.h>
20
20
#include <my_pthread.h>                         /* because of signal()  */
21
21
#include <sys/stat.h>
22
 
#include <mysql.h>
23
 
 
24
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
25
 
#include "../ndb/src/mgmclient/ndb_mgmclient.h"
26
 
#endif
27
22
 
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;
50
 
#endif
51
42
 
52
43
#ifdef HAVE_SMEM
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
105
 
  ,ADMIN_NDB_MGM
106
 
#endif
107
95
};
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
118
 
  "ndb-mgm",
119
 
#endif
120
105
  NullS
121
106
};
122
107
 
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},
221
 
#endif
222
199
  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
223
200
};
224
201
 
946
923
      }
947
924
      mysql->reconnect=1;       /* Automatic reconnect is default */
948
925
      break;
949
 
#ifdef LATER_HAVE_NDBCLUSTER_DB
950
 
    case ADMIN_NDB_MGM:
951
 
    {
952
 
      if (argc < 2)
953
 
      {
954
 
        my_printf_error(0, "Too few arguments to ndb-mgm", error_flags);
955
 
        return 1;
956
 
      }
957
 
      {
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);
962
 
      }
963
 
      argc= 0;
964
 
    }
965
 
    break;
966
 
#endif
967
926
    default:
968
927
      my_printf_error(0, "Unknown command: '%-.60s'", error_flags, argv[0]);
969
928
      return 1;