Commit eb0a423e authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

merged

parents 5faab668 a9097ca3
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
jcole@tetra.bedford.progress.com
jcole@tetra.spaceapes.com
sasha@laptop.slkc.uswest.net
monty@donna.mysql.com
sasha@mysql.sashanet.com
sasha@work.mysql.com
serg@serg.mysql.com
yfaktoro@nslinuxw2.bedford.progress.com
mwagner@evoq.home.mwagner.org
+818 −603

File changed.

Preview size limit exceeded, changes collapsed.

+12 −2
Original line number Diff line number Diff line
@@ -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
+11 −9
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
#include <my_pthread.h>				/* because of signal()	*/
#endif

#define ADMIN_VERSION "8.9"
#define ADMIN_VERSION "8.11"
#define MAX_MYSQL_VAR 64
#define MAX_TIME_TO_WAIT 3600			/* Wait for shutdown */
#define MAX_TRUNC_LENGTH 3
@@ -137,7 +137,7 @@ int main(int argc,char *argv[])
{
  int	c, error = 0,option_index=0;
  MYSQL mysql;
  char	*host = NULL,*password=0,*user=0,**commands;
  char	*host = NULL,*opt_password=0,*user=0,**commands;
  my_bool tty_password=0;
  MY_INIT(argv[0]);
  mysql_init(&mysql);
@@ -160,9 +160,12 @@ int main(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;
@@ -243,12 +246,11 @@ int main(int argc,char *argv[])
    exit(1);
  }
  if (tty_password)
    password = get_tty_password(NullS);
    opt_password = get_tty_password(NullS);

  VOID(signal(SIGINT,endprog));			/* Here if abort */
  VOID(signal(SIGTERM,endprog));		/* Here if abort */

  mysql_init(&mysql);
  if (opt_compress)
    mysql_options(&mysql,MYSQL_OPT_COMPRESS,NullS);
#ifdef HAVE_OPENSSL
@@ -256,7 +258,7 @@ int main(int argc,char *argv[])
    mysql_ssl_set(&mysql, opt_ssl_key, opt_ssl_cert, opt_ssl_ca,
		  opt_ssl_capath);
#endif /* HAVE_OPENSSL */
  if (sql_connect(&mysql,host,user,password,option_wait))
  if (sql_connect(&mysql,host,user,opt_password,option_wait))
    error = 1;
  else
  {
@@ -269,7 +271,7 @@ int main(int argc,char *argv[])
	if (option_wait && !interrupted)
	{
	  mysql_close(&mysql);
	  if (!sql_connect(&mysql,host,user,password,option_wait))
	  if (!sql_connect(&mysql,host,user,opt_password,option_wait))
	    continue;				/* Retry */
	}
	error=1;
@@ -286,7 +288,7 @@ int main(int argc,char *argv[])
    }
    mysql_close(&mysql);
  }
  my_free(password,MYF(MY_ALLOW_ZERO_PTR));
  my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
  my_free(user,MYF(MY_ALLOW_ZERO_PTR));
  free_defaults(argv);
  my_end(0);
+11 −9
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@
**   Tnu Samuel  <tonu@please.do.not.remove.this.spam.ee>
**/

#define DUMP_VERSION "8.10"
#define DUMP_VERSION "8.11"

#include <global.h>
#include <my_sys.h>
@@ -75,7 +75,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick=0, extended_insert = 0,
                opt_delayed=0,create_options=0,opt_quoted=0,opt_databases=0,
                opt_alldbs=0,opt_create_db=0,opt_first_slave=0;
static MYSQL  mysql_connection,*sock=0;
static char  insert_pat[12 * 1024],*password=0,*current_user=0,
static char  insert_pat[12 * 1024],*opt_password=0,*current_user=0,
             *current_host=0,*path=0,*fields_terminated=0,
             *lines_terminated=0, *enclosed=0, *opt_enclosed=0, *escaped=0,
             *where=0, *default_charset;
@@ -333,9 +333,12 @@ static int 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;
@@ -459,7 +462,7 @@ static int get_options(int *argc,char ***argv)
    return 1;
  }
  if (tty_password)
    password=get_tty_password(NullS);
    opt_password=get_tty_password(NullS);
  return(0);
} /* get_options */

@@ -596,7 +599,6 @@ static uint getTableStructure(char *table, char* db)

  sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d", opt_quoted);
  table_name=quote_name(table,table_buff);

  if (mysql_query(sock,insert_pat))
  {
    /* using SHOW CREATE statement */
@@ -1318,7 +1320,7 @@ int main(int argc, char **argv)
    my_end(0);
    exit(EX_USAGE);
  }
  if (dbConnect(current_host, current_user, password))
  if (dbConnect(current_host, current_user, opt_password))
    exit(EX_MYSQLERR);
  if (!path)
    write_heder(stdout, *argv);
@@ -1358,7 +1360,7 @@ int main(int argc, char **argv)
  }
  dbDisconnect(current_host);
  puts("");
  my_free(password, MYF(MY_ALLOW_ZERO_PTR));
  my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
  if (extended_insert)
    dynstr_free(&extended_row);
  my_end(0);
Loading