Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into ramayana.hindu.god:/home/tsmith/m/bk/maint/51
This commit is contained in:
commit
37cbd6f7b4
@ -692,9 +692,14 @@ static struct my_option my_long_options[] =
|
|||||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
0},
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &opt_mysql_port,
|
||||||
|
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
|
{"prompt", OPT_PROMPT, "Set the mysql prompt to this value.",
|
||||||
(uchar**) ¤t_prompt, (uchar**) ¤t_prompt, 0, GET_STR_ALLOC,
|
(uchar**) ¤t_prompt, (uchar**) ¤t_prompt, 0, GET_STR_ALLOC,
|
||||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -96,8 +96,13 @@ static struct my_option my_long_options[]=
|
|||||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
|
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0,
|
||||||
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"port", 'P', "Port number to use for connection.", 0,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"protocol", OPT_MYSQL_PROTOCOL,
|
{"protocol", OPT_MYSQL_PROTOCOL,
|
||||||
"The protocol of connection (tcp,socket,pipe,memory).",
|
"The protocol of connection (tcp,socket,pipe,memory).",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -173,7 +173,13 @@ static struct my_option my_long_options[] =
|
|||||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &tcp_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &tcp_port,
|
||||||
(uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &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).",
|
{"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},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -760,9 +760,14 @@ static struct my_option my_long_options[] =
|
|||||||
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, GET_ULL, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"password", 'p', "Password to connect to remote server.",
|
{"password", 'p', "Password to connect to remote server.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Use port to connect to the remote server.",
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0,
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
0, 0, 0},
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &port, (uchar**) &port, 0, GET_INT, REQUIRED_ARG,
|
||||||
|
0, 0, 0, 0, 0, 0},
|
||||||
{"position", 'j', "Deprecated. Use --start-position instead.",
|
{"position", 'j', "Deprecated. Use --start-position instead.",
|
||||||
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
(uchar**) &start_position, (uchar**) &start_position, 0, GET_ULL,
|
||||||
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
|
REQUIRED_ARG, BIN_LOG_HEADER_SIZE, BIN_LOG_HEADER_SIZE,
|
||||||
|
@ -142,7 +142,13 @@ static struct my_option my_long_options[] =
|
|||||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &opt_mysql_port,
|
||||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||||
0},
|
0},
|
||||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
|
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
|
||||||
|
@ -137,7 +137,13 @@ static struct my_option my_long_options[] =
|
|||||||
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
{"pipe", 'W', "Use named pipes to connect to server.", 0, 0, 0, GET_NO_ARG,
|
||||||
NO_ARG, 0, 0, 0, 0, 0, 0},
|
NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
#endif
|
#endif
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &opt_mysql_port,
|
||||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||||
0},
|
0},
|
||||||
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
|
{"protocol", OPT_MYSQL_PROTOCOL, "The protocol of connection (tcp,socket,pipe,memory).",
|
||||||
|
@ -196,7 +196,13 @@ static struct my_option my_long_options[] =
|
|||||||
{"password", 'p',
|
{"password", 'p',
|
||||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_mysql_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &opt_mysql_port,
|
||||||
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
(uchar**) &opt_mysql_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0,
|
||||||
0},
|
0},
|
||||||
#ifdef __WIN__
|
#ifdef __WIN__
|
||||||
|
@ -4946,7 +4946,13 @@ static struct my_option my_long_options[] =
|
|||||||
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
|
GET_INT, REQUIRED_ARG, 500, 1, 10000, 0, 0, 0},
|
||||||
{"password", 'p', "Password to use when connecting to server.",
|
{"password", 'p', "Password to use when connecting to server.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &opt_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &opt_port,
|
||||||
(uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &opt_port, 0, GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication",
|
{"ps-protocol", OPT_PS_PROTOCOL, "Use prepared statements protocol for communication",
|
||||||
(uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
|
(uchar**) &ps_protocol, (uchar**) &ps_protocol, 0,
|
||||||
|
29
configure.in
29
configure.in
@ -676,7 +676,34 @@ AC_ARG_WITH(tcp-port,
|
|||||||
[ --with-tcp-port=port-number
|
[ --with-tcp-port=port-number
|
||||||
Which port to use for MySQL services (default 3306)],
|
Which port to use for MySQL services (default 3306)],
|
||||||
[ MYSQL_TCP_PORT=$withval ],
|
[ MYSQL_TCP_PORT=$withval ],
|
||||||
[ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT ]
|
[ MYSQL_TCP_PORT=$MYSQL_TCP_PORT_DEFAULT
|
||||||
|
# if we actually defaulted (as opposed to the pathological case of
|
||||||
|
# --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
|
||||||
|
# happen if whole batch of servers was built from a script), set
|
||||||
|
# the default to zero to indicate that; we don't lose information
|
||||||
|
# that way, because 0 obviously indicates that we can get the
|
||||||
|
# default value from MYSQL_TCP_PORT. this seems really evil, but
|
||||||
|
# testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
|
||||||
|
# a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
|
||||||
|
# intend it to mean "use the default, in fact, look up a good default
|
||||||
|
# from /etc/services if you can", but really, really meant 3306 when
|
||||||
|
# they passed in 3306. When they pass in a specific value, let them
|
||||||
|
# have it; don't second guess user and think we know better, this will
|
||||||
|
# just make people cross. this makes the the logic work like this
|
||||||
|
# (which is complicated enough):
|
||||||
|
#
|
||||||
|
# - if a port was set during build, use that as a default.
|
||||||
|
#
|
||||||
|
# - otherwise, try to look up a port in /etc/services; if that fails,
|
||||||
|
# use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
|
||||||
|
#
|
||||||
|
# - allow the MYSQL_TCP_PORT environment variable to override that.
|
||||||
|
#
|
||||||
|
# - allow command-line parameters to override all of the above.
|
||||||
|
#
|
||||||
|
# the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
|
||||||
|
# so don't mess with that.
|
||||||
|
MYSQL_TCP_PORT_DEFAULT=0 ]
|
||||||
)
|
)
|
||||||
AC_SUBST(MYSQL_TCP_PORT)
|
AC_SUBST(MYSQL_TCP_PORT)
|
||||||
# We might want to document the assigned port in the manual.
|
# We might want to document the assigned port in the manual.
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#define FRM_VER @DOT_FRM_VERSION@
|
#define FRM_VER @DOT_FRM_VERSION@
|
||||||
#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@
|
#define MYSQL_VERSION_ID @MYSQL_VERSION_ID@
|
||||||
#define MYSQL_PORT @MYSQL_TCP_PORT@
|
#define MYSQL_PORT @MYSQL_TCP_PORT@
|
||||||
|
#define MYSQL_PORT_DEFAULT @MYSQL_TCP_PORT_DEFAULT@
|
||||||
#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@"
|
#define MYSQL_UNIX_ADDR "@MYSQL_UNIX_ADDR@"
|
||||||
#define MYSQL_CONFIG_NAME "my"
|
#define MYSQL_CONFIG_NAME "my"
|
||||||
#define MYSQL_COMPILATION_COMMENT "@COMPILATION_COMMENT@"
|
#define MYSQL_COMPILATION_COMMENT "@COMPILATION_COMMENT@"
|
||||||
|
@ -133,10 +133,23 @@ int STDCALL mysql_server_init(int argc __attribute__((unused)),
|
|||||||
{
|
{
|
||||||
struct servent *serv_ptr;
|
struct servent *serv_ptr;
|
||||||
char *env;
|
char *env;
|
||||||
if ((serv_ptr = getservbyname("mysql", "tcp")))
|
|
||||||
mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
|
/*
|
||||||
if ((env = getenv("MYSQL_TCP_PORT")))
|
if builder specifically requested a default port, use that
|
||||||
mysql_port =(uint) atoi(env);
|
(even if it coincides with our factory default).
|
||||||
|
only if they didn't do we check /etc/services (and, failing
|
||||||
|
on that, fall back to the factory default of 3306).
|
||||||
|
either default can be overridden by the environment variable
|
||||||
|
MYSQL_TCP_PORT, which in turn can be overridden with command
|
||||||
|
line options.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
if ((serv_ptr = getservbyname("mysql", "tcp")))
|
||||||
|
mysql_port = (uint) ntohs((ushort) serv_ptr->s_port);
|
||||||
|
#endif
|
||||||
|
if ((env = getenv("MYSQL_TCP_PORT")))
|
||||||
|
mysql_port =(uint) atoi(env);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -155,6 +155,7 @@ SUFFIXES = .sh
|
|||||||
-e 's!@''PERL''@!@PERL@!' \
|
-e 's!@''PERL''@!@PERL@!' \
|
||||||
-e 's!@''VERSION''@!@VERSION@!' \
|
-e 's!@''VERSION''@!@VERSION@!' \
|
||||||
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
||||||
|
-e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
|
||||||
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
|
-e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
|
||||||
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
||||||
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
--require r/windows.require
|
if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") = 0`)
|
||||||
disable_query_log;
|
{
|
||||||
select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Windows") as "TRUE";
|
skip Need windows;
|
||||||
enable_query_log;
|
}
|
||||||
|
|
||||||
|
@ -151,19 +151,16 @@ sub collect_one_suite($$)
|
|||||||
|
|
||||||
mtr_verbose("Collecting: $suite");
|
mtr_verbose("Collecting: $suite");
|
||||||
|
|
||||||
my $testdir;
|
my $suitedir= "$::glob_mysql_test_dir"; # Default
|
||||||
my $resdir;
|
if ( $suite ne "main" )
|
||||||
|
{
|
||||||
|
$suitedir= mtr_path_exists("$suitedir/suite/$suite",
|
||||||
|
"$suitedir/$suite");
|
||||||
|
mtr_verbose("suitedir: $suitedir");
|
||||||
|
}
|
||||||
|
|
||||||
if ( $suite eq "main" )
|
my $testdir= "$suitedir/t";
|
||||||
{
|
my $resdir= "$suitedir/r";
|
||||||
$testdir= "$::glob_mysql_test_dir/t";
|
|
||||||
$resdir= "$::glob_mysql_test_dir/r";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$testdir= "$::glob_mysql_test_dir/suite/$suite/t";
|
|
||||||
$resdir= "$::glob_mysql_test_dir/suite/$suite/r";
|
|
||||||
}
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------
|
# ----------------------------------------------------------------------
|
||||||
# Build a hash of disabled testcases for this suite
|
# Build a hash of disabled testcases for this suite
|
||||||
@ -205,7 +202,7 @@ sub collect_one_suite($$)
|
|||||||
$tname = basename($tname);
|
$tname = basename($tname);
|
||||||
|
|
||||||
# Get rid of suite part
|
# Get rid of suite part
|
||||||
$tname =~ s/^$suite\.//;
|
$tname =~ s/^(.*)\.//;
|
||||||
|
|
||||||
# Check if the extenstion has been specified.
|
# Check if the extenstion has been specified.
|
||||||
|
|
||||||
@ -333,7 +330,7 @@ sub collect_one_test_case($$$$$$$$$) {
|
|||||||
|
|
||||||
|
|
||||||
my $tinfo= {};
|
my $tinfo= {};
|
||||||
$tinfo->{'name'}= "$suite.$tname";
|
$tinfo->{'name'}= basename($suite) . ".$tname";
|
||||||
$tinfo->{'result_file'}= "$resdir/$tname.result";
|
$tinfo->{'result_file'}= "$resdir/$tname.result";
|
||||||
$tinfo->{'component_id'} = $component_id;
|
$tinfo->{'component_id'} = $component_id;
|
||||||
push(@$cases, $tinfo);
|
push(@$cases, $tinfo);
|
||||||
|
@ -23,7 +23,16 @@ USE_MANAGER=0
|
|||||||
MY_TZ=GMT-3
|
MY_TZ=GMT-3
|
||||||
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
|
TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
|
||||||
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
|
LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
|
||||||
MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
|
|
||||||
|
if [ -z "$MYSQL_TCP_PORT" ]; then
|
||||||
|
MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
|
||||||
|
if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
|
||||||
|
ESP=`getent services mysql/tcp`
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
MYSQL_TCP_PORT=`echo "$ESP"|sed -e's-^[a-z]*[ ]*\([0-9]*\)/[a-z]*$-\1-g'`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
umask 022
|
umask 022
|
||||||
|
|
||||||
|
@ -3742,6 +3742,11 @@ sub mysqld_arguments ($$$$) {
|
|||||||
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
mtr_add_arg($args, "%s--language=%s", $prefix, $path_language);
|
||||||
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
mtr_add_arg($args, "%s--tmpdir=$opt_tmpdir", $prefix);
|
||||||
|
|
||||||
|
# Increase default connect_timeout to avoid intermittent
|
||||||
|
# disconnects when test servers are put under load
|
||||||
|
# see BUG#28359
|
||||||
|
mtr_add_arg($args, "%s--connect-timeout=60", $prefix);
|
||||||
|
|
||||||
if ( $opt_valgrind_mysqld )
|
if ( $opt_valgrind_mysqld )
|
||||||
{
|
{
|
||||||
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
|
mtr_add_arg($args, "%s--skip-safemalloc", $prefix);
|
||||||
|
@ -11124,10 +11124,11 @@ auto fld1 companynr fld3 fld4 fld5 fld6
|
|||||||
SELECT COUNT(auto) FROM t2;
|
SELECT COUNT(auto) FROM t2;
|
||||||
COUNT(auto)
|
COUNT(auto)
|
||||||
1213
|
1213
|
||||||
INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
|
INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
|
||||||
|
INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
|
||||||
SELECT COUNT(auto) FROM t2;
|
SELECT COUNT(auto) FROM t2;
|
||||||
COUNT(auto)
|
COUNT(auto)
|
||||||
1214
|
1215
|
||||||
ALTER TABLE t2 DROP COLUMN fld6;
|
ALTER TABLE t2 DROP COLUMN fld6;
|
||||||
SHOW CREATE TABLE t2;
|
SHOW CREATE TABLE t2;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@ -11139,7 +11140,7 @@ t2 CREATE TABLE `t2` (
|
|||||||
`fld4` char(35) NOT NULL DEFAULT '',
|
`fld4` char(35) NOT NULL DEFAULT '',
|
||||||
`fld5` char(35) NOT NULL DEFAULT ''
|
`fld5` char(35) NOT NULL DEFAULT ''
|
||||||
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
|
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1
|
||||||
SELECT * FROM t2;
|
SELECT * FROM t2 WHERE auto != 100000;
|
||||||
auto fld1 companynr fld3 fld4 fld5
|
auto fld1 companynr fld3 fld4 fld5
|
||||||
1 000001 00 Omaha teethe neat
|
1 000001 00 Omaha teethe neat
|
||||||
2 011401 37 breaking dreaded Steinberg
|
2 011401 37 breaking dreaded Steinberg
|
||||||
@ -12354,7 +12355,7 @@ auto fld1 companynr fld3 fld4 fld5
|
|||||||
2 011401 37 breaking dreaded Steinberg
|
2 011401 37 breaking dreaded Steinberg
|
||||||
3 011402 37 Romans scholastics jarring
|
3 011402 37 Romans scholastics jarring
|
||||||
4 011403 37 intercepted audiology tinily
|
4 011403 37 intercepted audiology tinily
|
||||||
4 011403 37 intercepted audiology tinily
|
99999 011403 37 the delayed insert
|
||||||
CREATE TABLE `t5` (
|
CREATE TABLE `t5` (
|
||||||
`a` int(11) NOT NULL auto_increment,
|
`a` int(11) NOT NULL auto_increment,
|
||||||
b char(12),
|
b char(12),
|
||||||
|
2153
mysql-test/r/named_pipe.result
Normal file
2153
mysql-test/r/named_pipe.result
Normal file
File diff suppressed because it is too large
Load Diff
2155
mysql-test/r/shm.result
Normal file
2155
mysql-test/r/shm.result
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
|||||||
mysqld is alive
|
|
||||||
End of 5.0 tests.
|
|
@ -1351,8 +1351,16 @@ SELECT * FROM t2;
|
|||||||
|
|
||||||
# Test INSERT DELAYED and wait until the table has one more record
|
# Test INSERT DELAYED and wait until the table has one more record
|
||||||
SELECT COUNT(auto) FROM t2;
|
SELECT COUNT(auto) FROM t2;
|
||||||
INSERT DELAYED INTO t2 VALUES (4,011403,37,'intercepted','audiology','tinily','');
|
INSERT DELAYED INTO t2 VALUES (99999,011403,37,'the','delayed','insert','');
|
||||||
while (`SELECT COUNT(auto)!=1214 FROM t2`)
|
|
||||||
|
# Insert another record since in Archive delayed values are only
|
||||||
|
# guaranteed to materialize based on either:
|
||||||
|
# 1) A new row showing up from a normal insert
|
||||||
|
# 2) A flush table has occurred.
|
||||||
|
INSERT INTO t2 VALUES (100000,000001,00,'after','delayed','insert','');
|
||||||
|
|
||||||
|
# Wait for the delayed insert to appear
|
||||||
|
while (`SELECT COUNT(auto)!=1215 FROM t2`)
|
||||||
{
|
{
|
||||||
sleep 0.1;
|
sleep 0.1;
|
||||||
}
|
}
|
||||||
@ -1361,7 +1369,7 @@ SELECT COUNT(auto) FROM t2;
|
|||||||
# Adding test for ALTER TABLE
|
# Adding test for ALTER TABLE
|
||||||
ALTER TABLE t2 DROP COLUMN fld6;
|
ALTER TABLE t2 DROP COLUMN fld6;
|
||||||
SHOW CREATE TABLE t2;
|
SHOW CREATE TABLE t2;
|
||||||
SELECT * FROM t2;
|
SELECT * FROM t2 WHERE auto != 100000;
|
||||||
|
|
||||||
|
|
||||||
# Adding tests for autoincrement
|
# Adding tests for autoincrement
|
||||||
|
1
mysql-test/t/named_pipe-master.opt
Normal file
1
mysql-test/t/named_pipe-master.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--loose-enable-named-pipe
|
14
mysql-test/t/named_pipe.test
Normal file
14
mysql-test/t/named_pipe.test
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# We currently only have named pipe support on windows, so
|
||||||
|
# in order to optimize things we skip this test on all
|
||||||
|
# other platforms
|
||||||
|
--source include/windows.inc
|
||||||
|
|
||||||
|
# Only run this test if named pipe is avaliable
|
||||||
|
let $nmp= query_get_value("SHOW VARIABLES LIKE 'named_pipe'", Value, 1);
|
||||||
|
if (`SELECT '$nmp' != 'ON'`){
|
||||||
|
skip No named pipe support;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Source select test case
|
||||||
|
-- source include/common-tests.inc
|
||||||
|
|
@ -1 +1 @@
|
|||||||
--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --loose-shared-memory=1
|
--skip-grant-tables --loose-shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$MTR_BUILD_THREAD --loose-shared-memory=1
|
19
mysql-test/t/shm.test
Normal file
19
mysql-test/t/shm.test
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# We currently only have shm support on windows, so in order
|
||||||
|
# to optimize things we skip this test on all other platforms
|
||||||
|
--source include/windows.inc
|
||||||
|
|
||||||
|
# Only run this test if shared memory is avaliable
|
||||||
|
let $shm= query_get_value("SHOW VARIABLES LIKE 'shared_memory'", Value, 1);
|
||||||
|
if (`SELECT '$shm' != 'ON'`){
|
||||||
|
skip No shm support;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Source select test case
|
||||||
|
-- source include/common-tests.inc
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
|
||||||
|
#
|
||||||
|
--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
|
||||||
|
|
||||||
|
--echo End of 5.0 tests.
|
@ -1,9 +0,0 @@
|
|||||||
# Windows-specific tests
|
|
||||||
--source include/windows.inc
|
|
||||||
|
|
||||||
#
|
|
||||||
# Bug #24924: shared-memory-base-name that is too long causes buffer overflow
|
|
||||||
#
|
|
||||||
--exec $MYSQLADMIN --no-defaults --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --shared-memory-base-name=HeyMrBaseNameXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ping
|
|
||||||
|
|
||||||
--echo End of 5.0 tests.
|
|
@ -1169,7 +1169,8 @@ void setup(char *file)
|
|||||||
setenv("MYSQL_BINLOG", file_path, 1);
|
setenv("MYSQL_BINLOG", file_path, 1);
|
||||||
setenv("MASTER_MYPORT", "9306", 1);
|
setenv("MASTER_MYPORT", "9306", 1);
|
||||||
setenv("SLAVE_MYPORT", "9307", 1);
|
setenv("SLAVE_MYPORT", "9307", 1);
|
||||||
setenv("MYSQL_TCP_PORT", "3306", 1);
|
snprintf(file_path, PATH_MAX*2, "%d", MYSQL_PORT);
|
||||||
|
setenv("MYSQL_TCP_PORT", file_path, 1);
|
||||||
snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port);
|
snprintf(file_path, PATH_MAX*2, "%s/mysql_client_test --no-defaults --testcase--user=root --port=%u ", bin_dir, master_port);
|
||||||
setenv("MYSQL_CLIENT_TEST",file_path,1);
|
setenv("MYSQL_CLIENT_TEST",file_path,1);
|
||||||
snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port);
|
snprintf(file_path, PATH_MAX*2, "%s/mysql --no-defaults --user=root --port=%u ", bin_dir, master_port);
|
||||||
|
@ -189,7 +189,7 @@ void start_defaults(int argc, char *argv[])
|
|||||||
snprintf(address, PATH_MAX, "0.0.0.0");
|
snprintf(address, PATH_MAX, "0.0.0.0");
|
||||||
|
|
||||||
// port
|
// port
|
||||||
snprintf(port, PATH_MAX, "3306");
|
snprintf(port, PATH_MAX, "%d", MYSQL_PORT);
|
||||||
|
|
||||||
// default option
|
// default option
|
||||||
default_option[0]= NULL;
|
default_option[0]= NULL;
|
||||||
|
@ -163,6 +163,7 @@ SUFFIXES = .sh
|
|||||||
-e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
|
-e 's!@''MYSQLD_DEFAULT_SWITCHES''@!@MYSQLD_DEFAULT_SWITCHES@!' \
|
||||||
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
-e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
|
||||||
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
-e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
|
||||||
|
-e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
|
||||||
-e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
|
-e 's!@''TARGET_LINUX''@!@TARGET_LINUX@!' \
|
||||||
-e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
|
-e "s!@""CONF_COMMAND""@!@CONF_COMMAND@!" \
|
||||||
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
|
-e 's!@''MYSQLD_USER''@!@MYSQLD_USER@!' \
|
||||||
|
@ -92,9 +92,14 @@ fix_path pkgincludedir include/mysql include
|
|||||||
|
|
||||||
version='@VERSION@'
|
version='@VERSION@'
|
||||||
socket='@MYSQL_UNIX_ADDR@'
|
socket='@MYSQL_UNIX_ADDR@'
|
||||||
port='@MYSQL_TCP_PORT@'
|
|
||||||
ldflags='@LDFLAGS@'
|
ldflags='@LDFLAGS@'
|
||||||
|
|
||||||
|
if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
|
||||||
|
port=0
|
||||||
|
else
|
||||||
|
port=@MYSQL_TCP_PORT@
|
||||||
|
fi
|
||||||
|
|
||||||
# Create options
|
# Create options
|
||||||
# We intentionally add a space to the beginning and end of lib strings, simplifies replace later
|
# We intentionally add a space to the beginning and end of lib strings, simplifies replace later
|
||||||
libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
|
libs=" $ldflags -L$pkglibdir -lmysqlclient @ZLIB_DEPS@ @NON_THREADED_LIBS@"
|
||||||
|
@ -25,6 +25,7 @@ sql_only=0
|
|||||||
basedir="@prefix@"
|
basedir="@prefix@"
|
||||||
verbose=0
|
verbose=0
|
||||||
args=""
|
args=""
|
||||||
|
# no elaborate fallback here; with no argument, it will happen in "mysql"
|
||||||
port=""
|
port=""
|
||||||
socket=""
|
socket=""
|
||||||
database="mysql"
|
database="mysql"
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "portability.h"
|
#include "portability.h"
|
||||||
|
|
||||||
/* IM-wide platform-independent defines */
|
/* IM-wide platform-independent defines */
|
||||||
#define SERVER_DEFAULT_PORT 3306
|
#define SERVER_DEFAULT_PORT MYSQL_PORT
|
||||||
#define DEFAULT_MONITORING_INTERVAL 20
|
#define DEFAULT_MONITORING_INTERVAL 20
|
||||||
#define DEFAULT_PORT 2273
|
#define DEFAULT_PORT 2273
|
||||||
/* three-week timeout should be enough */
|
/* three-week timeout should be enough */
|
||||||
|
@ -327,8 +327,13 @@ protected:
|
|||||||
#define PRECISION_FOR_DOUBLE 53
|
#define PRECISION_FOR_DOUBLE 53
|
||||||
#define PRECISION_FOR_FLOAT 24
|
#define PRECISION_FOR_FLOAT 24
|
||||||
|
|
||||||
|
/*
|
||||||
|
Default time to wait before aborting a new client connection
|
||||||
|
that does not respond to "initial server greeting" timely
|
||||||
|
*/
|
||||||
|
#define CONNECT_TIMEOUT 10
|
||||||
|
|
||||||
/* The following can also be changed from the command line */
|
/* The following can also be changed from the command line */
|
||||||
#define CONNECT_TIMEOUT 5 // Do not wait long for connect
|
|
||||||
#define DEFAULT_CONCURRENCY 10
|
#define DEFAULT_CONCURRENCY 10
|
||||||
#define DELAYED_LIMIT 100 /* pause after xxx inserts */
|
#define DELAYED_LIMIT 100 /* pause after xxx inserts */
|
||||||
#define DELAYED_QUEUE_SIZE 1000
|
#define DELAYED_QUEUE_SIZE 1000
|
||||||
|
@ -1361,8 +1361,21 @@ static void set_ports()
|
|||||||
{ // Get port if not from commandline
|
{ // Get port if not from commandline
|
||||||
struct servent *serv_ptr;
|
struct servent *serv_ptr;
|
||||||
mysqld_port= MYSQL_PORT;
|
mysqld_port= MYSQL_PORT;
|
||||||
|
|
||||||
|
/*
|
||||||
|
if builder specifically requested a default port, use that
|
||||||
|
(even if it coincides with our factory default).
|
||||||
|
only if they didn't do we check /etc/services (and, failing
|
||||||
|
on that, fall back to the factory default of 3306).
|
||||||
|
either default can be overridden by the environment variable
|
||||||
|
MYSQL_TCP_PORT, which in turn can be overridden with command
|
||||||
|
line options.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
if ((serv_ptr= getservbyname("mysql", "tcp")))
|
if ((serv_ptr= getservbyname("mysql", "tcp")))
|
||||||
mysqld_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */
|
mysqld_port= ntohs((u_short) serv_ptr->s_port); /* purecov: inspected */
|
||||||
|
#endif
|
||||||
if ((env = getenv("MYSQL_TCP_PORT")))
|
if ((env = getenv("MYSQL_TCP_PORT")))
|
||||||
mysqld_port= (uint) atoi(env); /* purecov: inspected */
|
mysqld_port= (uint) atoi(env); /* purecov: inspected */
|
||||||
}
|
}
|
||||||
@ -5625,7 +5638,13 @@ master-ssl",
|
|||||||
{"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
|
{"pid-file", OPT_PID_FILE, "Pid file used by safe_mysqld.",
|
||||||
(uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR,
|
(uchar**) &pidfile_name_ptr, (uchar**) &pidfile_name_ptr, 0, GET_STR,
|
||||||
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Port number to use for connection.", (uchar**) &mysqld_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &mysqld_port,
|
||||||
(uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &mysqld_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port-open-timeout", OPT_PORT_OPEN_TIMEOUT,
|
{"port-open-timeout", OPT_PORT_OPEN_TIMEOUT,
|
||||||
"Maximum time in seconds to wait for the port to become free. "
|
"Maximum time in seconds to wait for the port to become free. "
|
||||||
|
@ -1106,11 +1106,12 @@ char * is_const(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
my_bool check_const_len_init(UDF_INIT *initid, UDF_ARGS *args, char *message)
|
||||||
{
|
{
|
||||||
if (args->arg_count != 1)
|
if (args->arg_count != 1)
|
||||||
{
|
{
|
||||||
strmov(message, "IS_CONST accepts only one argument");
|
strmov(message, "CHECK_CONST_LEN accepts only one argument");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (args->args[0] == 0)
|
if (args->args[0] == 0)
|
||||||
@ -1140,5 +1141,4 @@ char * check_const_len(UDF_INIT *initid, UDF_ARGS *args __attribute__((unused)),
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* HAVE_DLOPEN */
|
#endif /* HAVE_DLOPEN */
|
||||||
|
@ -16475,7 +16475,13 @@ static struct my_option client_test_long_options[] =
|
|||||||
{"password", 'p',
|
{"password", 'p',
|
||||||
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
"Password to use when connecting to server. If password is not given it's asked from the tty.",
|
||||||
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Port number to use for connection", (uchar **) &opt_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar **) &opt_port,
|
||||||
(uchar **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar **) &opt_port, 0, GET_UINT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"server-arg", 'A', "Send embedded server this as a parameter.",
|
{"server-arg", 'A', "Send embedded server this as a parameter.",
|
||||||
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -44,7 +44,7 @@ int main(int argc, char **argv)
|
|||||||
"../SSL/MySQL-client-cert.pem",
|
"../SSL/MySQL-client-cert.pem",
|
||||||
"../SSL/MySQL-ca-cert.pem", 0, 0);
|
"../SSL/MySQL-ca-cert.pem", 0, 0);
|
||||||
#endif
|
#endif
|
||||||
if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],3306,NULL,0)))
|
if (!(sock = mysql_real_connect(&mysql,"127.0.0.1",0,0,argv[1],MYSQL_PORT,NULL,0)))
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql));
|
fprintf(stderr,"Couldn't connect to engine!\n%s\n\n",mysql_error(&mysql));
|
||||||
perror("");
|
perror("");
|
||||||
|
@ -103,7 +103,13 @@ static struct my_option my_long_options[] =
|
|||||||
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &verbose, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"query", 'Q', "Query to execute in each threads", (uchar**) &query,
|
{"query", 'Q', "Query to execute in each threads", (uchar**) &query,
|
||||||
(uchar**) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &query, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
{"port", 'P', "Port number to use for connection", (uchar**) &tcp_port,
|
{"port", 'P', "Port number to use for connection or 0 for default to, in "
|
||||||
|
"order of preference, my.cnf, $MYSQL_TCP_PORT, "
|
||||||
|
#if MYSQL_PORT_DEFAULT == 0
|
||||||
|
"/etc/services, "
|
||||||
|
#endif
|
||||||
|
"built-in default (" STRINGIFY_ARG(MYSQL_PORT) ").",
|
||||||
|
(uchar**) &tcp_port,
|
||||||
(uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
|
(uchar**) &tcp_port, 0, GET_UINT, REQUIRED_ARG, MYSQL_PORT, 0, 0, 0, 0, 0},
|
||||||
{"socket", 'S', "Socket file to use for connection", (uchar**) &unix_socket,
|
{"socket", 'S', "Socket file to use for connection", (uchar**) &unix_socket,
|
||||||
(uchar**) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
(uchar**) &unix_socket, 0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
@ -31,6 +31,7 @@ try
|
|||||||
configureInTS.Close();
|
configureInTS.Close();
|
||||||
var default_comment = "Source distribution";
|
var default_comment = "Source distribution";
|
||||||
var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT");
|
var default_port = GetValue(configureIn, "MYSQL_TCP_PORT_DEFAULT");
|
||||||
|
var actual_port = 0;
|
||||||
|
|
||||||
var configfile = fso.CreateTextFile("win\\configure.data", true);
|
var configfile = fso.CreateTextFile("win\\configure.data", true);
|
||||||
for (i=0; i < args.Count(); i++)
|
for (i=0; i < args.Count(); i++)
|
||||||
@ -59,10 +60,41 @@ try
|
|||||||
default_comment = parts[1];
|
default_comment = parts[1];
|
||||||
break;
|
break;
|
||||||
case "MYSQL_TCP_PORT":
|
case "MYSQL_TCP_PORT":
|
||||||
default_port = parts[1];
|
actual_port = parts[1];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (actual_port == 0)
|
||||||
|
{
|
||||||
|
// if we actually defaulted (as opposed to the pathological case of
|
||||||
|
// --with-tcp-port=<MYSQL_TCP_PORT_DEFAULT> which might in theory
|
||||||
|
// happen if whole batch of servers was built from a script), set
|
||||||
|
// the default to zero to indicate that; we don't lose information
|
||||||
|
// that way, because 0 obviously indicates that we can get the
|
||||||
|
// default value from MYSQL_TCP_PORT. this seems really evil, but
|
||||||
|
// testing for MYSQL_TCP_PORT==MYSQL_TCP_PORT_DEFAULT would make a
|
||||||
|
// a port of MYSQL_TCP_PORT_DEFAULT magic even if the builder did not
|
||||||
|
// intend it to mean "use the default, in fact, look up a good default
|
||||||
|
// from /etc/services if you can", but really, really meant 3306 when
|
||||||
|
// they passed in 3306. When they pass in a specific value, let them
|
||||||
|
// have it; don't second guess user and think we know better, this will
|
||||||
|
// just make people cross. this makes the the logic work like this
|
||||||
|
// (which is complicated enough):
|
||||||
|
//
|
||||||
|
// - if a port was set during build, use that as a default.
|
||||||
|
//
|
||||||
|
// - otherwise, try to look up a port in /etc/services; if that fails,
|
||||||
|
// use MYSQL_TCP_PORT_DEFAULT (at the time of this writing 3306)
|
||||||
|
//
|
||||||
|
// - allow the MYSQL_TCP_PORT environment variable to override that.
|
||||||
|
//
|
||||||
|
// - allow command-line parameters to override all of the above.
|
||||||
|
//
|
||||||
|
// the top-most MYSQL_TCP_PORT_DEFAULT is read from win/configure.js,
|
||||||
|
// so don't mess with that.
|
||||||
|
actual_port = default_port;
|
||||||
|
default_port = 0;
|
||||||
|
}
|
||||||
|
|
||||||
configfile.WriteLine("SET (COMPILATION_COMMENT \"" +
|
configfile.WriteLine("SET (COMPILATION_COMMENT \"" +
|
||||||
default_comment + "\")");
|
default_comment + "\")");
|
||||||
@ -71,7 +103,8 @@ try
|
|||||||
GetValue(configureIn, "PROTOCOL_VERSION") + "\")");
|
GetValue(configureIn, "PROTOCOL_VERSION") + "\")");
|
||||||
configfile.WriteLine("SET (DOT_FRM_VERSION \"" +
|
configfile.WriteLine("SET (DOT_FRM_VERSION \"" +
|
||||||
GetValue(configureIn, "DOT_FRM_VERSION") + "\")");
|
GetValue(configureIn, "DOT_FRM_VERSION") + "\")");
|
||||||
configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + default_port + "\")");
|
configfile.WriteLine("SET (MYSQL_TCP_PORT_DEFAULT \"" + default_port + "\")");
|
||||||
|
configfile.WriteLine("SET (MYSQL_TCP_PORT \"" + actual_port + "\")");
|
||||||
configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" +
|
configfile.WriteLine("SET (MYSQL_UNIX_ADDR \"" +
|
||||||
GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\")");
|
GetValue(configureIn, "MYSQL_UNIX_ADDR_DEFAULT") + "\")");
|
||||||
var version = GetVersion(configureIn);
|
var version = GetVersion(configureIn);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user