diff options
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 22 | ||||
-rw-r--r-- | sql-common/my_time.c | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index a627619550a..049ddd0e701 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -70,11 +70,6 @@ my_bool net_flush(NET *net); #include <my_pthread.h> /* because of signal() */ #endif /* defined(THREAD) && !defined(__WIN__) */ -#if defined(OS2) && defined(MYSQL_SERVER) -#undef ER -#define ER CER -#endif /* defined( OS2) && defined(MYSQL_SERVER) */ - #include <sys/stat.h> #include <signal.h> #include <time.h> @@ -125,7 +120,7 @@ const char *def_shared_memory_base_name= default_shared_memory_base_name; static void mysql_close_free_options(MYSQL *mysql); static void mysql_close_free(MYSQL *mysql); -#if !(defined(__WIN__) || defined(OS2) || defined(__NETWARE__)) +#if !(defined(__WIN__) || defined(__NETWARE__)) static int wait_for_data(my_socket fd, uint timeout); #endif @@ -144,7 +139,7 @@ CHARSET_INFO *default_client_charset_info = &my_charset_latin1; int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, uint timeout) { -#if defined(__WIN__) || defined(OS2) || defined(__NETWARE__) +#if defined(__WIN__) || defined(__NETWARE__) return connect(fd, (struct sockaddr*) name, namelen); #else int flags, res, s_err; @@ -184,7 +179,7 @@ int my_connect(my_socket fd, const struct sockaddr *name, uint namelen, If not, we will use select() */ -#if !(defined(__WIN__) || defined(OS2) || defined(__NETWARE__)) +#if !(defined(__WIN__) || defined(__NETWARE__)) static int wait_for_data(my_socket fd, uint timeout) { @@ -275,7 +270,7 @@ static int wait_for_data(my_socket fd, uint timeout) return (0); /* ok */ #endif /* HAVE_POLL */ } -#endif /* defined(__WIN__) || defined(OS2) || defined(__NETWARE__) */ +#endif /* defined(__WIN__) || defined(__NETWARE__) */ /* @@ -686,7 +681,12 @@ cli_advanced_command(MYSQL *mysql, enum enum_server_command command, mysql->net.report_error=0; mysql->info=0; mysql->affected_rows= ~(my_ulonglong) 0; - net_clear(&mysql->net); /* Clear receive buffer */ + /* + We don't want to clear the protocol buffer on COM_QUIT, beacsue if + the previous command was a shutdown command, we may have the + response for the COM_QUIT already in the communication buffer + */ + net_clear(&mysql->net, (command != COM_QUIT)); if (net_write_command(net,(uchar) command, header, header_length, arg, arg_length)) @@ -2507,7 +2507,7 @@ my_bool mysql_reconnect(MYSQL *mysql) mysql_close(mysql); *mysql=tmp_mysql; mysql_fix_pointers(mysql, &tmp_mysql); /* adjust connection pointers */ - net_clear(&mysql->net); + net_clear(&mysql->net, 1); mysql->affected_rows= ~(my_ulonglong) 0; DBUG_RETURN(0); } diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 8496c0ceba1..b9b712148a0 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -740,7 +740,7 @@ long calc_daynr(uint year,uint month,uint day) if (year == 0 && month == 0 && day == 0) DBUG_RETURN(0); /* Skip errors */ - if (year < 200) + if (year < YY_MAGIC_BELOW) { if ((year=year+1900) < 1900+YY_PART_YEAR) year+=100; |