mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
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
This commit is contained in:
@@ -115,7 +115,7 @@ static bool info_flag=0,ignore_errors=0,wait_flag=0,quick=0,
|
||||
opt_compress=0,
|
||||
vertical=0,skip_line_numbers=0,skip_column_names=0,opt_html=0,
|
||||
no_named_cmds=1; // we want this to be the default
|
||||
static uint verbose=0,opt_silent=0,opt_mysql_port=0;
|
||||
static uint verbose=0,opt_silent=0,opt_mysql_port=0,opt_connect_timeout=0;
|
||||
static my_string opt_mysql_unix_port=0;
|
||||
static int connect_flag=CLIENT_INTERACTIVE;
|
||||
static char *current_host,*current_db,*current_user=0,*opt_password=0,
|
||||
@@ -334,7 +334,7 @@ sig_handler mysql_end(int sig)
|
||||
exit(status.exit_status);
|
||||
}
|
||||
|
||||
enum options {OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET} ;
|
||||
enum options {OPT_CHARSETS_DIR=256, OPT_DEFAULT_CHARSET, OPT_TIMEOUT} ;
|
||||
|
||||
|
||||
static struct option long_options[] =
|
||||
@@ -374,6 +374,7 @@ static struct option long_options[] =
|
||||
{"socket", required_argument, 0, 'S'},
|
||||
#include "sslopt-longopts.h"
|
||||
{"table", no_argument, 0, 't'},
|
||||
{"timeout", required_argument, 0, OPT_TIMEOUT},
|
||||
#ifndef DONT_ALLOW_USER_CHANGE
|
||||
{"user", required_argument, 0, 'u'},
|
||||
#endif
|
||||
@@ -545,9 +546,12 @@ static int get_options(int argc, char **argv)
|
||||
case 'p':
|
||||
if (optarg)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
tty_password=1;
|
||||
@@ -603,6 +607,9 @@ static int get_options(int argc, char **argv)
|
||||
opt_mysql_unix_port=my_strdup(MYSQL_NAMEDPIPE,MYF(0));
|
||||
#endif
|
||||
break;
|
||||
case OPT_TIMEOUT:
|
||||
opt_connect_timeout=atoi(optarg);
|
||||
break;
|
||||
case 'V': usage(1); exit(0);
|
||||
case 'I':
|
||||
case '?':
|
||||
@@ -1772,6 +1779,9 @@ sql_real_connect(char *host,char *database,char *user,char *password,
|
||||
connected= 0;
|
||||
}
|
||||
mysql_init(&mysql);
|
||||
if (opt_connect_timeout)
|
||||
mysql_options(&mysql,MYSQL_OPT_CONNECT_TIMEOUT,
|
||||
(char*) &opt_connect_timeout);
|
||||
if (opt_compress)
|
||||
mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||
#ifdef HAVE_OPENSSL
|
||||
|
Reference in New Issue
Block a user