summaryrefslogtreecommitdiff
path: root/client/mysqladmin.c
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-03 12:59:31 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-03 12:59:31 +0300
commit702256ebaa12ca37724f68da2bd5f5d2959b1e8f (patch)
treebe04186411dc657ef6bbcbe01267d30f2675c914 /client/mysqladmin.c
parent775d09780fb32c101c4e5da2807817c1d1231ce9 (diff)
parent7daf5a5d0ee7b52508943c7095a2cc150abcf616 (diff)
downloadmariadb-git-702256ebaa12ca37724f68da2bd5f5d2959b1e8f.tar.gz
merge with 4.0
BitKeeper/etc/ignore: auto-union BitKeeper/etc/logging_ok: auto-union BUILD/SETUP.sh: Auto merged BUILD/compile-pentium-debug: Auto merged BitKeeper/triggers/post-commit: Auto merged configure.in: Auto merged Docs/manual.texi: Auto merged client/mysql.cc: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged extra/mysql_install.c: Auto merged extra/resolve_stack_dump.c: Auto merged extra/resolveip.c: Auto merged include/my_sys.h: Auto merged include/mysqld_error.h: Auto merged isam/pack_isam.c: Auto merged libmysql/Makefile.shared: Auto merged libmysql/libmysql.c: Auto merged myisam/ft_dump.c: Auto merged myisam/ft_test1.c: Auto merged myisam/ftdefs.h: Auto merged myisam/mi_check.c: Auto merged myisam/mi_test1.c: Auto merged myisam/mi_write.c: Auto merged myisam/myisamchk.c: Auto merged myisam/myisampack.c: Auto merged mysql-test/mysql-test-run.sh: Auto merged mysql-test/r/select_found.result: Auto merged mysql-test/t/select_found.test: Auto merged mysys/charset.c: Auto merged mysys/default.c: Auto merged mysys/hash.c: Auto merged sql/field.cc: Auto merged sql/gen_lex_hash.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/hostname.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_strfunc.cc: Auto merged sql/item_timefunc.h: Auto merged sql/lex.h: Auto merged sql/log.cc: Auto merged sql/mysql_priv.h: Auto merged sql/repl_failsafe.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_db.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_string.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_union.cc: Auto merged sql/share/czech/errmsg.txt: Auto merged sql/share/danish/errmsg.txt: Auto merged sql/share/dutch/errmsg.txt: Auto merged sql/share/english/errmsg.txt: Auto merged sql/share/estonian/errmsg.txt: Auto merged sql/share/german/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/share/hungarian/errmsg.txt: Auto merged sql/share/italian/errmsg.txt: Auto merged sql/share/japanese/errmsg.txt: Auto merged sql/share/korean/errmsg.txt: Auto merged sql/share/norwegian-ny/errmsg.txt: Auto merged sql/share/norwegian/errmsg.txt: Auto merged sql/sql_update.cc: Auto merged sql/structs.h: Auto merged sql/share/polish/errmsg.txt: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/russian/errmsg.txt: Auto merged sql/share/slovak/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged sql/share/ukrainian/errmsg.txt: Auto merged strings/Makefile.am: Auto merged strings/ctype-ujis.c: Auto merged tools/mysqlmanager.c: Auto merged
Diffstat (limited to 'client/mysqladmin.c')
-rw-r--r--client/mysqladmin.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index 7f6d1d1a85d..fd2a17eee31 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -19,12 +19,11 @@
#include "client_priv.h"
#include <signal.h>
-#include <my_getopt.h>
#ifdef THREAD
#include <my_pthread.h> /* because of signal() */
#endif
-#define ADMIN_VERSION "8.30"
+#define ADMIN_VERSION "8.35"
#define MAX_MYSQL_VAR 64
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
@@ -124,25 +123,27 @@ static struct my_option my_long_options[] =
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"port", 'P', "Port number to use for connection.", 0, 0, 0,
- GET_LONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
+ (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"relative", 'r',
"Show difference between current and previous values when used with -i. Currently works only with extended-status.",
(gptr*) &opt_relative, (gptr*) &opt_relative, 0, GET_BOOL, NO_ARG, 0, 0, 0,
0, 0, 0},
{"set-variable", 'O',
- "Change the value of a variable. Please note that this option is depricated; you can set variables directly with --variable-name=value.",
+ "Change the value of a variable. Please note that this option is deprecated; you can set variables directly with --variable-name=value.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"silent", 's', "Silently exit if one can't connect to server",
0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
{"socket", 'S', "Socket file to use for connection.",
- 0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &unix_port, (gptr*) &unix_port, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
+ 0, 0, 0},
{"sleep", 'i', "Execute commands again and again with a sleep between.",
- 0, 0, 0, GET_LONG, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &interval, (gptr*) &interval, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0,
+ 0, 0},
#include "sslopt-longopts.h"
#ifndef DONT_ALLOW_USER_CHANGE
{"user", 'u', "User for login if not current user.", (gptr*) &user,
- (gptr*) &user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+ (gptr*) &user, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"verbose", 'v', "Write more information.", (gptr*) &opt_verbose,
(gptr*) &opt_verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
@@ -155,10 +156,10 @@ static struct my_option my_long_options[] =
{"wait", 'w', "Wait and retry if connection is down", 0, 0, 0, GET_NO_ARG,
NO_ARG, 0, 0, 0, 0, 0, 0},
{"connect_timeout", OPT_CONNECT_TIMEOUT, "", (gptr*) &opt_connect_timeout,
- (gptr*) &opt_connect_timeout, 0, GET_LONG, REQUIRED_ARG, 3600*12, 0,
+ (gptr*) &opt_connect_timeout, 0, GET_ULONG, REQUIRED_ARG, 3600*12, 0,
3600*12, 0, 1, 0},
{"shutdown_timeout", OPT_SHUTDOWN_TIMEOUT, "", (gptr*) &opt_shutdown_timeout,
- (gptr*) &opt_shutdown_timeout, 0, GET_LONG, REQUIRED_ARG,
+ (gptr*) &opt_shutdown_timeout, 0, GET_ULONG, REQUIRED_ARG,
SHUTDOWN_DEF_TIMEOUT, 0, 3600*12, 0, 1, 0},
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
};
@@ -173,10 +174,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
int error = 0;
switch(optid) {
- case 'h':
- host = argument;
- break;
- case 'q': /* Allow old 'q' option */
case 'p':
if (argument)
{
@@ -190,23 +187,9 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
else
tty_password=1;
break;
-#ifndef DONT_ALLOW_USER_CHANGE
- case 'u':
- user= my_strdup(argument,MYF(0));
- break;
-#endif
- case 'i':
- interval=atoi(argument);
- break;
- case 'P':
- tcp_port= (unsigned int) atoi(argument);
- break;
case 's':
option_silent++;
break;
- case 'S':
- unix_port= argument;
- break;
case 'W':
#ifdef __WIN__
unix_port=MYSQL_NAMEDPIPE;
@@ -264,11 +247,8 @@ int main(int argc,char *argv[])
free_defaults()
*/
if ((ho_error=handle_options(&argc, &argv, my_long_options, get_one_option)))
- {
- printf("%s: handle_options() failed with error %d\n", my_progname,
- ho_error);
- exit(1);
- }
+ exit(ho_error);
+
if (argc == 0)
{
usage();