diff options
author | unknown <monty@hundin.mysql.fi> | 2001-09-12 23:54:22 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2001-09-12 23:54:22 +0300 |
commit | c88dd9b291cf7fe9086102d74d255f4b880d1486 (patch) | |
tree | a1113c56652cc8609f61548a39b493926e4d06ad /sql | |
parent | 93a15f452eb08eab559b12b1947cfae71fc628f5 (diff) | |
parent | 76989cf55c016a9d8619f582f753444241a4d934 (diff) | |
download | mariadb-git-c88dd9b291cf7fe9086102d74d255f4b880d1486.tar.gz |
Merge work:/home/bk/mysql into hundin.mysql.fi:/my/bk/mysql
Diffstat (limited to 'sql')
-rw-r--r-- | sql/handler.h | 2 | ||||
-rw-r--r-- | sql/mini_client.cc | 12 | ||||
-rw-r--r-- | sql/mysqld.cc | 23 | ||||
-rw-r--r-- | sql/net_serv.cc | 4 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 | ||||
-rw-r--r-- | sql/unireg.cc | 4 |
6 files changed, 23 insertions, 24 deletions
diff --git a/sql/handler.h b/sql/handler.h index ef78f0af39b..4ce743a5edd 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -77,7 +77,7 @@ #define HA_NO_FULLTEXT_KEY (HA_NO_PREFIX_CHAR_KEYS*2) /* Parameters for open() (in register form->filestat) */ - /* HA_GET_INFO does a implicit HA_ABORT_IF_LOCKED */ + /* HA_GET_INFO does an implicit HA_ABORT_IF_LOCKED */ #define HA_OPEN_KEYFILE 1 #define HA_OPEN_RNDFILE 2 diff --git a/sql/mini_client.cc b/sql/mini_client.cc index fe8a0a161b3..3dfd58375a5 100644 --- a/sql/mini_client.cc +++ b/sql/mini_client.cc @@ -98,16 +98,10 @@ static void mc_free_old_query(MYSQL *mysql); #define CLIENT_CAPABILITIES (CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_LOCAL_FILES) #if defined(MSDOS) || defined(__WIN__) -#define ERRNO WSAGetLastError() #define perror(A) -#elif defined(OS2) -#define ERRNO sock_errno() -#define SOCKET_ERROR -1 #else -#include <sys/errno.h> -#define ERRNO errno +#include <errno.h> #define SOCKET_ERROR -1 -#define closesocket(A) close(A) #endif #ifdef __WIN__ @@ -351,7 +345,7 @@ mc_net_safe_read(MYSQL *mysql) { DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %d", vio_description(net->vio),len)); - if (socket_errno != EINTR) + if (socket_errno != SOCKET_EINTR) { mc_end_server(mysql); if(net->last_errno != ER_NET_PACKET_TOO_LARGE) @@ -544,7 +538,7 @@ mc_mysql_connect(MYSQL *mysql,const char *host, const char *user, if ((sock = socket(AF_UNIX,SOCK_STREAM,0)) == SOCKET_ERROR) { net->last_errno=CR_SOCKET_CREATE_ERROR; - sprintf(net->last_error,ER(net->last_errno),ERRNO); + sprintf(net->last_error,ER(net->last_errno),socket_errno); goto error; } net->vio = vio_new(sock, VIO_TYPE_SOCKET, TRUE); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index b7cd101695a..9aa56ea7fc1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1455,10 +1455,6 @@ static int my_message_sql(uint error, const char *str, } #ifdef __WIN__ -#undef errno -#undef EINTR -#define errno WSAGetLastError() -#define EINTR WSAEINTR struct utsname { @@ -1571,18 +1567,26 @@ int main(int argc, char **argv) tzset(); // Set tzname start_time=time((time_t*) 0); +#ifdef OS2 + { + // fix timezone for daylight saving + struct tm *ts = localtime(&start_time); + if (ts->tm_isdst > 0) + _timezone -= 3600; + } +#endif #ifdef HAVE_TZNAME #if defined(HAVE_LOCALTIME_R) && defined(_REENTRANT) { struct tm tm_tmp; localtime_r(&start_time,&tm_tmp); - strmov(time_zone,tzname[tm_tmp.tm_isdst == 1 ? 1 : 0]); + strmov(time_zone,tzname[tm_tmp.tm_isdst != 0 ? 1 : 0]); } #else { struct tm *start_tm; start_tm=localtime(&start_time); - strmov(time_zone,tzname[start_tm->tm_isdst == 1 ? 1 : 0]); + strmov(time_zone,tzname[start_tm->tm_isdst != 0 ? 1 : 0]); } #endif #endif @@ -2263,7 +2267,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) #else if (select((int) max_used_connection,&readFDs,0,0,0) < 0) { - if (socket_errno != EINTR) + if (socket_errno != SOCKET_EINTR) { if (!select_errors++ && !abort_loop) /* purecov: inspected */ sql_print_error("mysqld: Got error %d from select",socket_errno); /* purecov: inspected */ @@ -2306,7 +2310,8 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) size_socket length=sizeof(struct sockaddr_in); new_sock = accept(sock, my_reinterpret_cast(struct sockaddr *) (&cAddr), &length); - if (new_sock != INVALID_SOCKET || (errno != EINTR && errno != EAGAIN)) + if (new_sock != INVALID_SOCKET || + (socket_errno != SOCKET_EINTR && socket_errno != SOCKET_EAGAIN)) break; #if !defined(NO_FCNTL_NONBLOCK) if (!(test_flags & TEST_BLOCKING)) @@ -2324,7 +2329,7 @@ pthread_handler_decl(handle_connections_sockets,arg __attribute__((unused))) { if ((error_count++ & 255) == 0) // This can happen often sql_perror("Error in accept"); - if (errno == ENFILE || errno == EMFILE) + if (socket_errno == SOCKET_ENFILE || socket_errno == SOCKET_EMFILE) sleep(1); // Give other threads some time continue; } diff --git a/sql/net_serv.cc b/sql/net_serv.cc index c9bfd977e78..4d4603ed586 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -277,7 +277,7 @@ net_real_write(NET *net,const char *packet,ulong len) int length; char *pos,*end; thr_alarm_t alarmed; -#if !defined(__WIN__) && !defined(__EMX__) && !defined(OS2) +#if !defined(__WIN__) ALARM alarm_buff; #endif uint retry_count=0; @@ -372,7 +372,7 @@ net_real_write(NET *net,const char *packet,ulong len) #endif /* EXTRA_DEBUG */ } #if defined(THREAD_SAFE_CLIENT) && !defined(MYSQL_SERVER) - if (vio_errno(net->vio) == EINTR) + if (vio_errno(net->vio) == SOCKET_EINTR) { DBUG_PRINT("warning",("Interrupted write. Retrying...")); continue; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 8f4082c6688..4735e8a08ec 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -182,7 +182,7 @@ int quick_rm_table(enum db_type base,const char *db, } /***************************************************************************** - * Create at table. + * Create a table. * If one creates a temporary table, this is automaticly opened ****************************************************************************/ diff --git a/sql/unireg.cc b/sql/unireg.cc index d02af0ef0d0..c5bfbbbea88 100644 --- a/sql/unireg.cc +++ b/sql/unireg.cc @@ -18,7 +18,7 @@ /* Functions to create a unireg form-file from a FIELD and a fieldname-fieldinfo struct. - In the following functions FIELD * is a ordinary field-structure with + In the following functions FIELD * is an ordinary field-structure with the following exeptions: sc_length,typepos,row,kol,dtype,regnr and field nead not to be set. str is a (long) to record position where 0 is the first position. @@ -502,7 +502,7 @@ static bool pack_fields(File file,List<create_field> &create_fields) } - /* save a empty record on start of formfile */ + /* save an empty record on start of formfile */ static bool make_empty_rec(File file,enum db_type table_type, uint table_options, |