diff options
author | svoj@mysql.com/june.mysql.com <> | 2007-11-09 16:05:01 +0400 |
---|---|---|
committer | svoj@mysql.com/june.mysql.com <> | 2007-11-09 16:05:01 +0400 |
commit | c6abad79c8592cae49102c4402a497ea0a8de89f (patch) | |
tree | 8bd71a7336b97dbc37f5e488f279239ee4595d0c | |
parent | 377f187066553d669013fcccd5ea8c8fcf7147a5 (diff) | |
download | mariadb-git-c6abad79c8592cae49102c4402a497ea0a8de89f.tar.gz |
BUG#29083 - test suite times out on OS X 64bit - also in older releases
The "mysql client in mysqld"(which is used by
replication and federated) should use alarms instead of setting
socket timeout value if the rest of the server uses alarm. By
always calling 'my_net_set_write_timeout'
or 'net_set_read_timeout' when changing the timeout value(s), the
selection whether to use alarms or timeouts will be handled by
ifdef's in those two functions.
This is minimal backport of patch for BUG#26664, which was pushed
to 5.0 and up.
Affects 4.1 only.
-rw-r--r-- | include/mysql_com.h | 5 | ||||
-rw-r--r-- | sql-common/client.c | 6 | ||||
-rw-r--r-- | sql/mysql_priv.h | 3 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/mysql_com.h b/include/mysql_com.h index 56c7f7d2ab5..daeb540c7c8 100644 --- a/include/mysql_com.h +++ b/include/mysql_com.h @@ -291,6 +291,11 @@ my_bool net_write_command(NET *net,unsigned char command, int net_real_write(NET *net,const char *packet,unsigned long len); unsigned long my_net_read(NET *net); +#ifdef _global_h +void net_set_write_timeout(NET *net, uint timeout); +void net_set_read_timeout(NET *net, uint timeout); +#endif + /* The following function is not meant for normal usage Currently it's used internally by manager.c diff --git a/sql-common/client.c b/sql-common/client.c index bf9c7252283..82a2f9d7bd0 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1884,13 +1884,11 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, /* If user set read_timeout, let it override the default */ if (mysql->options.read_timeout) - net->read_timeout= mysql->options.read_timeout; - vio_timeout(net->vio, 0, net->read_timeout); + net_set_read_timeout(net, mysql->options.read_timeout); /* If user set write_timeout, let it override the default */ if (mysql->options.write_timeout) - net->write_timeout= mysql->options.write_timeout; - vio_timeout(net->vio, 1, net->write_timeout); + net_set_write_timeout(net, mysql->options.write_timeout); if (mysql->options.max_allowed_packet) net->max_packet_size= mysql->options.max_allowed_packet; diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index b5100c15473..b6170ba35f9 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -59,9 +59,6 @@ void kill_one_thread(THD *thd, ulong id); 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; } } #define PREV_BITS(type,A) ((type) (((type) 1 << (A)) -1)) |