summaryrefslogtreecommitdiff
path: root/client/mysqladmin.c
diff options
context:
space:
mode:
authorunknown <jani@rhols221.adsl.netsonic.fi>2002-05-14 21:41:55 +0300
committerunknown <jani@rhols221.adsl.netsonic.fi>2002-05-14 21:41:55 +0300
commit21c1e5be444f61c96351ff7d27e955356a65c7d6 (patch)
tree4ab693251c296105301806199ac0d1ee72bdf62f /client/mysqladmin.c
parentf20dda3ea9c36589955b85abcff5bea5bb534330 (diff)
downloadmariadb-git-21c1e5be444f61c96351ff7d27e955356a65c7d6.tar.gz
- Added new type GET_STRALC to my_getopt.
- Fixed some bugs, wrongly freed pointers, in some clients. - Removed unneccessary code. - Fixed some other minor bugs and added some options into variables category, which had accidently been left out earlier. client/mysql.cc: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqladmin.c: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqlcheck.c: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqldump.c: Fixed some wrong freed pointers. Removed unneccessary code. Changed some types from GET_STR to GET_STRALC. client/mysqlimport.c: Removed unneccessary code. Fixed a bug in option --ignore-lines client/mysqlshow.c: Removed unneccessary code. include/my_getopt.h: Added new type, GET_STRALC. The name stands for GET STRING ALLOC, which means that the struct member value and u_max_value are strings that must be alloced and freed when used. The normal GET_STR works similarly otherwise, except that it's arguments are just pointers to strings, not alloced ones. mysys/my_getopt.c: Added support for GET_STRALC
Diffstat (limited to 'client/mysqladmin.c')
-rw-r--r--client/mysqladmin.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/client/mysqladmin.c b/client/mysqladmin.c
index 08ff9546111..6bab465b488 100644
--- a/client/mysqladmin.c
+++ b/client/mysqladmin.c
@@ -24,7 +24,7 @@
#include <my_pthread.h> /* because of signal() */
#endif
-#define ADMIN_VERSION "8.31"
+#define ADMIN_VERSION "8.32"
#define MAX_MYSQL_VAR 64
#define SHUTDOWN_DEF_TIMEOUT 3600 /* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
@@ -136,14 +136,15 @@ static struct my_option my_long_options[] =
{"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.",
(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_STRALC, 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},
@@ -174,10 +175,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)
{
@@ -191,23 +188,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;