Below is the list of changes that have just been committed into a local
4.1 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-01-29 16:19:59+01:00, msvensson@stripped +3 -0
Merge pilot.mysql.com:/home/msvensson/mysql/bug22943/my41-bug22943
into pilot.mysql.com:/home/msvensson/mysql/mysql-4.1-maint
MERGE: 1.2596.3.1
sql/mysql_priv.h@stripped, 2007-01-29 16:19:57+01:00, msvensson@stripped +0 -0
Auto merged
MERGE: 1.384.2.2
sql/set_var.cc@stripped, 2007-01-29 16:19:57+01:00, msvensson@stripped +0 -0
Auto merged
MERGE: 1.189.1.1
sql/sql_parse.cc@stripped, 2007-01-29 16:19:58+01:00, msvensson@stripped +0 -0
Auto merged
MERGE: 1.489.4.2
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: pilot.mysql.com
# Root: /home/msvensson/mysql/mysql-4.1-maint/RESYNC
--- 1.386/sql/mysql_priv.h 2007-01-17 19:28:52 +01:00
+++ 1.387/sql/mysql_priv.h 2007-01-29 16:19:57 +01:00
@@ -59,6 +59,8 @@
bool net_request_file(NET* net, const char* fname);
char* query_table_status(THD *thd,const char *db,const char *table_name);
+void net_set_write_timeout(NET *net, uint timeout);
+void net_set_read_timeout(NET *net, uint timeout);
#define x_free(A) { my_free((gptr) (A),MYF(MY_WME | MY_FAE | MY_ALLOW_ZERO_PTR)); }
#define safeFree(x) { if(x) { my_free((gptr) x,MYF(0)); x = NULL; } }
--- 1.493/sql/sql_parse.cc 2007-01-18 17:53:28 +01:00
+++ 1.494/sql/sql_parse.cc 2007-01-29 16:19:58 +01:00
@@ -867,7 +867,7 @@
return(ER_HANDSHAKE_ERROR);
}
DBUG_PRINT("info", ("IO layer change in progress..."));
- if (sslaccept(ssl_acceptor_fd, net->vio, thd->variables.net_wait_timeout))
+ if (sslaccept(ssl_acceptor_fd, net->vio, net->read_timeout))
{
DBUG_PRINT("error", ("Failed to read user information (pkt_len= %lu)",
pkt_len));
@@ -897,7 +897,6 @@
if ((thd->client_capabilities & CLIENT_TRANSACTIONS) &&
opt_using_transactions)
net->return_status= &thd->server_status;
- net->read_timeout=(uint) thd->variables.net_read_timeout;
char *user= end;
char *passwd= strend(user)+1;
@@ -1029,6 +1028,10 @@
NET *net= &thd->net;
thd->thread_stack= (char*) &thd;
+ /* Use "connect_timeout" value during connection phase */
+ net_set_read_timeout(net, connect_timeout);
+ net_set_write_timeout(net, connect_timeout);
+
if ((error=check_connection(thd)))
{ // Wrong permissions
if (error > 0)
@@ -1058,6 +1061,11 @@
if (thd->query_error)
thd->killed= 1;
}
+
+ /* Connect completed, set read/write timeouts back to tdefault */
+ net_set_read_timeout(net, thd->variables.net_read_timeout);
+ net_set_write_timeout(net, thd->variables.net_write_timeout);
+
while (!net->error && net->vio != 0 && !thd->killed)
{
if (do_command(thd))
@@ -1261,7 +1269,7 @@
#ifndef EMBEDDED_LIBRARY
/*
- Read one command from socket and execute it (query or simple command).
+ Read one command from connection and execute it (query or simple command).
This function is called in loop from thread function.
SYNOPSIS
do_command()
@@ -1272,24 +1280,26 @@
bool do_command(THD *thd)
{
- char *packet;
- uint old_timeout;
+ char *packet= 0;
ulong packet_length;
- NET *net;
+ NET *net= &thd->net;
enum enum_server_command command;
DBUG_ENTER("do_command");
- net= &thd->net;
/*
indicator of uninitialized lex => normal flow of errors handling
(see my_message_sql)
*/
thd->lex->current_select= 0;
- packet=0;
- old_timeout=net->read_timeout;
- // Wait max for 8 hours
- net->read_timeout=(uint) thd->variables.net_wait_timeout;
+ /*
+ This thread will do a blocking read from the client which
+ will be interrupted when the next command is received from
+ the client, the connection is closed or "net_wait_timeout"
+ number of seconds has passed
+ */
+ net_set_read_timeout(net, thd->variables.net_wait_timeout);
+
thd->clear_error(); // Clear error message
net_new_transaction(net);
@@ -1318,7 +1328,10 @@
vio_description(net->vio), command,
command_name[command]));
}
- net->read_timeout=old_timeout; // restore it
+
+ /* Restore read timeout value */
+ net_set_read_timeout(net, thd->variables.net_read_timeout);
+
/*
packet_length contains length of data, as it was stored in packet
header. In case of malformed header, packet_length can be zero.
--- 1.190/sql/set_var.cc 2006-12-08 23:33:13 +01:00
+++ 1.191/sql/set_var.cc 2007-01-29 16:19:57 +01:00
@@ -1128,14 +1128,14 @@
static void fix_net_read_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- thd->net.read_timeout=thd->variables.net_read_timeout;
+ net_set_read_timeout(&thd->net, thd->variables.net_read_timeout);
}
static void fix_net_write_timeout(THD *thd, enum_var_type type)
{
if (type != OPT_GLOBAL)
- thd->net.write_timeout=thd->variables.net_write_timeout;
+ net_set_write_timeout(&thd->net, thd->variables.net_write_timeout);
}
static void fix_net_retry_count(THD *thd, enum_var_type type)
| Thread |
|---|
| • bk commit into 4.1 tree (msvensson:1.2612) | msvensson | 29 Jan |