Commit a247d3a3 authored by unknown's avatar unknown
Browse files

Fix being able to set default TCP port for command-line utilities

by using MYSQL_TCP_PORT variable. (Bug #5792)


client/mysql.cc:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqladmin.cc:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqlbinlog.cc:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqlcheck.c:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqldump.c:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqlimport.c:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqlshow.c:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
client/mysqltest.c:
  Set default port to 0 so MYSQL_TCP_PORT is handled by mysql_server_init().
parent c8067ec8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -610,7 +610,7 @@ static struct my_option my_long_options[] =
   NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
  {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
   0},
  {"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
   (gptr*) &current_prompt, (gptr*) &current_prompt, 0, GET_STR_ALLOC,
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ static struct my_option my_long_options[] =
   NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
  {"port", 'P', "Port number to use for connection.", (gptr*) &tcp_port,
   (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
   (gptr*) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
  {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
    0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
  {"relative", 'r',
+2 −2
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ static const char* database= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
static ulonglong offset = 0;
static const char* host = 0;
static int port = MYSQL_PORT;
static int port= 0;
static const char* sock= 0;
static const char* user = 0;
static char* pass = 0;
@@ -462,7 +462,7 @@ static struct my_option my_long_options[] =
  {"password", 'p', "Password to connect to remote server.",
   0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
  {"port", 'P', "Use port to connect to the remote server.",
   (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, MYSQL_PORT, 0, 0,
   (gptr*) &port, (gptr*) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
   0, 0, 0},
  {"position", 'j', "Deprecated. Use --start-position instead.",
   (gptr*) &start_position, (gptr*) &start_position, 0, GET_ULL,
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ static struct my_option my_long_options[] =
   NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
  {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
   0},
  {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
   0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
+1 −1
Original line number Diff line number Diff line
@@ -322,7 +322,7 @@ static struct my_option my_long_options[] =
   NO_ARG, 0, 0, 0, 0, 0, 0},
#endif
  {"port", 'P', "Port number to use for connection.", (gptr*) &opt_mysql_port,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0,
   (gptr*) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
   0},
  {"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
   0, 0, 0, GET_STR,  REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
Loading