summaryrefslogtreecommitdiff
path: root/client/mysqlshow.c
diff options
context:
space:
mode:
authorunknown <monty@tik.mysql.com>2000-11-13 23:55:10 +0200
committerunknown <monty@tik.mysql.com>2000-11-13 23:55:10 +0200
commitf3d2341f1f30384d92b285c1e421d8c599ee2b79 (patch)
tree6689cb755cdb6ba0fb4cc6fbb215d75b175228d2 /client/mysqlshow.c
parent675d31ee9a14d636d838400c670d0a1c2b964c9a (diff)
downloadmariadb-git-f3d2341f1f30384d92b285c1e421d8c599ee2b79.tar.gz
Bug fixes, TRUNCATE, safer passwords on command line and connect timeout
Docs/manual.texi: Update of safe_mysqld, TRUNCATE and changes for 3.23.28 client/mysql.cc: Added --timeout client/mysqladmin.c: Safer password handling client/mysqldump.c: Safer password handling client/mysqlimport.c: Safer password handling client/mysqlshow.c: Safer password handling configure.in: Fixes for Darwin and added test of poll include/my_pthread.h: Fixes for darwin include/violite.h: Added test for polling libmysql/libmysql.c: connect timeout libmysql/violite.c: connect timeout mysys/hash.c: Fix when delting from empty table scripts/safe_mysqld.sh: Added --open-files, --core-file-size and --timezone sql-bench/bench-init.pl.sh: Function print_time sql-bench/crash-me.sh: Added test of truncate sql-bench/test-insert.sh: More "estimated" tests sql-bench/test-select.sh: More "estimated" tests sql/filesort.cc: Removed allocation of extra memory sql/ha_berkeley.cc: Better estimation of number of rows sql/item_create.cc: Truncate sql/item_create.h: Truncate sql/item_strfunc.cc: Removed usage of MY_FAE sql/lex.h: Truncate sql/lock.cc: Fixed possible loop bug sql/log.cc: Removed usage of FILE:s sql/mysqld.cc: Print of more server variables sql/sql_class.h: Changed FILE -> File sql/sql_insert.cc: Fixed bug in temptable handling sql/sql_lex.h: Cleanup sql/sql_load.cc: Removed usage of MY_FAE sql/sql_parse.cc: Cleanup + TRUNCATE sql/sql_select.cc: Cleanup + fix for INSERT ... SELECT sql/sql_yacc.yy: TRUNCATE sql/violite.c: Merge with client/violite.c strings/strstr-sparc.s: Fixed wrong register usage
Diffstat (limited to 'client/mysqlshow.c')
-rw-r--r--client/mysqlshow.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index bf924ddeecd..3c34b2df4b5 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -28,7 +28,7 @@
#include <stdarg.h>
#include <getopt.h>
-static my_string host=0,password=0,user=0;
+static my_string host=0,opt_password=0,user=0;
static my_bool opt_show_keys=0,opt_compress=0,opt_status=0;
static void get_options(int *argc,char ***argv);
@@ -88,15 +88,13 @@ int main(int argc, char **argv)
mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
opt_ssl_capath);
#endif
- if (!(mysql_real_connect(&mysql,host,user,password,
+ if (!(mysql_real_connect(&mysql,host,user,opt_password,
argv[0],opt_mysql_port,opt_mysql_unix_port,
0)))
{
fprintf(stderr,"%s: %s\n",my_progname,mysql_error(&mysql));
exit(1);
}
- /* if (!(mysql_connect(&mysql,host,user,password))) */
-
switch (argc)
{
@@ -111,11 +109,12 @@ int main(int argc, char **argv)
if (opt_status && ! wild)
error=list_table_status(&mysql,argv[0],argv[1]);
else
- error=list_fields(&mysql,argv[0],argv[1],wild); break;
+ error=list_fields(&mysql,argv[0],argv[1],wild);
+ break;
}
mysql_close(&mysql); /* Close & free connection */
- if (password)
- my_free(password,MYF(0));
+ if (opt_password)
+ my_free(opt_password,MYF(0));
my_end(0);
exit(error ? 1 : 0);
return 0; /* No compiler warnings */
@@ -223,9 +222,12 @@ get_options(int *argc,char ***argv)
case 'p':
if (optarg)
{
- my_free(password,MYF(MY_ALLOW_ZERO_PTR));
- password=my_strdup(optarg,MYF(MY_FAE));
+ char *start=optarg;
+ my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
+ opt_password=my_strdup(optarg,MYF(MY_FAE));
while (*optarg) *optarg++= 'x'; /* Destroy argument */
+ if (*start)
+ start[1]=0; /* Cut length of argument */
}
else
tty_password=1;
@@ -266,7 +268,7 @@ get_options(int *argc,char ***argv)
(*argc)-=optind;
(*argv)+=optind;
if (tty_password)
- password=get_tty_password(NullS);
+ opt_password=get_tty_password(NullS);
return;
}