diff options
author | unknown <monty@mashka.mysql.fi> | 2003-11-17 13:00:15 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-11-17 13:00:15 +0200 |
commit | d544ef768cec04122e7b4a558bc03b2da837815b (patch) | |
tree | 7a9eb11f52d6cc6fa5a0f13bb21f2b32d2607aa3 | |
parent | e6298f379e642a8e3867c7cb185ae5fa1615b497 (diff) | |
parent | b57a1dd22731b436c52bddd2fe4f368429ebb59c (diff) | |
download | mariadb-git-d544ef768cec04122e7b4a558bc03b2da837815b.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-3.23
into mashka.mysql.fi:/home/my/mysql-3.23
-rw-r--r-- | mysys/thr_alarm.c | 3 | ||||
-rw-r--r-- | sql/mini_client.cc | 17 |
2 files changed, 13 insertions, 7 deletions
diff --git a/mysys/thr_alarm.c b/mysys/thr_alarm.c index f51f27b7f51..564d46aca3a 100644 --- a/mysys/thr_alarm.c +++ b/mysys/thr_alarm.c @@ -638,7 +638,8 @@ bool thr_got_alarm(thr_alarm_t *alrm_ptr) void thr_end_alarm(thr_alarm_t *alrm_ptr) { thr_alarm_t alrm= *alrm_ptr; - if (alrm->crono) + /* alrm may be zero if thr_alarm aborted with an error */ + if (alrm && alrm->crono) { KillTimer(NULL, alrm->crono); alrm->crono = 0; diff --git a/sql/mini_client.cc b/sql/mini_client.cc index c7beeea37b8..cd56081e6a8 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -15,13 +15,14 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* - mini MySQL client to be included into the server to do server to server - commincation by Sasha Pachev + mini MySQL client to be included into the server to do server to server + commincation by Sasha Pachev - Note: all file-global symbols must begin with mc_ , even the static ones, just - in case we decide to make them external at some point - */ + Note: all file-global symbols must begin with mc_ , even the static + ones, just in case we decide to make them external at some point +*/ +#include <global.h> #define DONT_USE_RAID #if defined(__WIN__) #include <winsock.h> @@ -40,7 +41,6 @@ inline int local_thr_alarm(my_bool *A,int B __attribute__((unused)),ALARM *C __a #define thr_got_alarm(A) 0 #endif -#include <global.h> #include <my_sys.h> #include <mysys_err.h> #include <m_string.h> @@ -597,6 +597,11 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, sprintf(host_info=buff,ER(CR_TCP_CONNECTION),host); DBUG_PRINT("info",("Server name: '%s'. TCP sock: %d", host,port)); thr_alarm_init(&alarmed); + /* + We don't have to check status for thr_alarm as it's not fatal if + we didn't manage to set an alarm. (In this case the socket call + will just block for a while). + */ thr_alarm(&alarmed, net_read_timeout, &alarm_buff); sock = (my_socket) socket(AF_INET,SOCK_STREAM,0); thr_end_alarm(&alarmed); |