Commit af64d85a authored by unknown's avatar unknown

Fix for bug #16855


BitKeeper/etc/ignore:
  Added mysql-test/r/bdb.log mysql-test/r/im_client_port.log to the ignore list
client/mysql.cc:
  If --socket is not set, provides --protocol=TCP when --port=
  is specified (and --protocol= is not specified.)
parent ab123657
...@@ -1275,3 +1275,5 @@ zlib/*.ds? ...@@ -1275,3 +1275,5 @@ zlib/*.ds?
zlib/*.vcproj zlib/*.vcproj
scripts/mysql_upgrade scripts/mysql_upgrade
include/openssl include/openssl
mysql-test/r/bdb.log
mysql-test/r/im_client_port.log
...@@ -653,7 +653,7 @@ static struct my_option my_long_options[] = ...@@ -653,7 +653,7 @@ static struct my_option my_long_options[] =
"Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name, "Base name of shared memory.", (gptr*) &shared_memory_base_name, (gptr*) &shared_memory_base_name,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"socket", 'S', "Socket file to use for connection.", {"socket", 'S', "Socket file to use for connection. (This will override --port unless --protocol=TCP is specified.)",
(gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR_ALLOC, (gptr*) &opt_mysql_unix_port, (gptr*) &opt_mysql_unix_port, 0, GET_STR_ALLOC,
REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#include "sslopt-longopts.h" #include "sslopt-longopts.h"
...@@ -940,6 +940,13 @@ static int get_options(int argc, char **argv) ...@@ -940,6 +940,13 @@ static int get_options(int argc, char **argv)
connect_flag= 0; /* Not in interactive mode */ connect_flag= 0; /* Not in interactive mode */
} }
if (opt_mysql_port && (!opt_protocol) && (!opt_mysql_unix_port))
{
/* Not checking return type since we are using a constant value */
/* straight from the initialization of sql_protocol_typelib. */
opt_protocol= find_type("TCP", &sql_protocol_typelib, 0);
}
if (strcmp(default_charset, charset_info->csname) && if (strcmp(default_charset, charset_info->csname) &&
!(charset_info= get_charset_by_csname(default_charset, !(charset_info= get_charset_by_csname(default_charset,
MY_CS_PRIMARY, MYF(MY_WME)))) MY_CS_PRIMARY, MYF(MY_WME))))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment