mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Backporting patch for Bug#38992 from 6.0.
Original revision: revno: 2617.55.2 committer: Alexander Nozdrin <alik@sun.com> branch nick: azalea-bf-bug38992 timestamp: Fri 2009-06-19 16:41:16 +0400 message: Fix for Bug#38992: Server crashes sporadically with 'waiting for initial ...' msg on windows. The problem is that connection timeout is too small for busy windows box. The fix is to - add support for connect_timeout command line argument to mysqltest; - set default value of the connect_timeout option to 120 seconds.
This commit is contained in:
@ -112,6 +112,8 @@ static uint my_end_arg= 0;
|
|||||||
/* Number of lines of the result to include in failure report */
|
/* Number of lines of the result to include in failure report */
|
||||||
static uint opt_tail_lines= 0;
|
static uint opt_tail_lines= 0;
|
||||||
|
|
||||||
|
static uint opt_connect_timeout= 0;
|
||||||
|
|
||||||
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
|
static char delimiter[MAX_DELIMITER_LENGTH]= ";";
|
||||||
static uint delimiter_length= 1;
|
static uint delimiter_length= 1;
|
||||||
|
|
||||||
@ -5007,6 +5009,11 @@ void do_connect(struct st_command *command)
|
|||||||
#endif
|
#endif
|
||||||
if (!mysql_init(&con_slot->mysql))
|
if (!mysql_init(&con_slot->mysql))
|
||||||
die("Failed on mysql_init()");
|
die("Failed on mysql_init()");
|
||||||
|
|
||||||
|
if (opt_connect_timeout)
|
||||||
|
mysql_options(&con_slot->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||||
|
(void *) &opt_connect_timeout);
|
||||||
|
|
||||||
if (opt_compress || con_compress)
|
if (opt_compress || con_compress)
|
||||||
mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
mysql_options(&con_slot->mysql, MYSQL_OPT_COMPRESS, NullS);
|
||||||
mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
mysql_options(&con_slot->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||||
@ -5762,6 +5769,11 @@ static struct my_option my_long_options[] =
|
|||||||
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
|
{"view-protocol", OPT_VIEW_PROTOCOL, "Use views for select",
|
||||||
(uchar**) &view_protocol, (uchar**) &view_protocol, 0,
|
(uchar**) &view_protocol, (uchar**) &view_protocol, 0,
|
||||||
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
|
||||||
|
{"connect_timeout", OPT_CONNECT_TIMEOUT,
|
||||||
|
"Number of seconds before connection timeout.",
|
||||||
|
(uchar**) &opt_connect_timeout,
|
||||||
|
(uchar**) &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
|
||||||
|
120, 0, 3600 * 12, 0, 0, 0},
|
||||||
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
{ 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -6985,6 +6997,10 @@ int util_query(MYSQL* org_mysql, const char* query){
|
|||||||
if (!(mysql= mysql_init(mysql)))
|
if (!(mysql= mysql_init(mysql)))
|
||||||
die("Failed in mysql_init()");
|
die("Failed in mysql_init()");
|
||||||
|
|
||||||
|
if (opt_connect_timeout)
|
||||||
|
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||||
|
(void *) &opt_connect_timeout);
|
||||||
|
|
||||||
/* enable local infile, in non-binary builds often disabled by default */
|
/* enable local infile, in non-binary builds often disabled by default */
|
||||||
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
mysql_options(mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||||
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
|
safe_connect(mysql, "util", org_mysql->host, org_mysql->user,
|
||||||
@ -7644,6 +7660,9 @@ int main(int argc, char **argv)
|
|||||||
st_connection *con= connections;
|
st_connection *con= connections;
|
||||||
if (!( mysql_init(&con->mysql)))
|
if (!( mysql_init(&con->mysql)))
|
||||||
die("Failed in mysql_init()");
|
die("Failed in mysql_init()");
|
||||||
|
if (opt_connect_timeout)
|
||||||
|
mysql_options(&con->mysql, MYSQL_OPT_CONNECT_TIMEOUT,
|
||||||
|
(void *) &opt_connect_timeout);
|
||||||
if (opt_compress)
|
if (opt_compress)
|
||||||
mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
mysql_options(&con->mysql,MYSQL_OPT_COMPRESS,NullS);
|
||||||
mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
mysql_options(&con->mysql, MYSQL_OPT_LOCAL_INFILE, 0);
|
||||||
|
Reference in New Issue
Block a user