summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysqlmanagerc.c16
-rw-r--r--libmysql/manager.c38
-rw-r--r--scripts/make_binary_distribution.sh2
-rw-r--r--sql/mysqld.cc4
-rw-r--r--tools/mysqlmanager.c11
5 files changed, 29 insertions, 42 deletions
diff --git a/client/mysqlmanagerc.c b/client/mysqlmanagerc.c
index 66b77e237e2..4e34c85d55d 100644
--- a/client/mysqlmanagerc.c
+++ b/client/mysqlmanagerc.c
@@ -17,27 +17,15 @@
#define MANAGER_CLIENT_VERSION "1.0"
#include <my_global.h>
-#include <my_sys.h>
-#include <m_string.h>
#include <mysql.h>
#include <mysql_version.h>
-#include <m_ctype.h>
-#ifdef OS2
-#include <config-os2.h>
-#else
-#include <my_config.h>
-#endif
-#include <my_dir.h>
-#include <hash.h>
#include <mysqld_error.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <my_sys.h>
+#include <m_string.h>
#include <getopt.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <errno.h>
-#include <violite.h>
#ifndef MYSQL_MANAGER_PORT
#define MYSQL_MANAGER_PORT 23546
diff --git a/libmysql/manager.c b/libmysql/manager.c
index 07595ab8dee..2f34f49209c 100644
--- a/libmysql/manager.c
+++ b/libmysql/manager.c
@@ -16,31 +16,30 @@
MA 02111-1307, USA */
#include <my_global.h>
-#if defined(__WIN__) || defined(_WIN32) || defined(_WIN64)
-#include <winsock.h>
-#include <odbcinst.h>
+#if defined(THREAD)
+#include <my_pthread.h> /* because of signal() */
#endif
+#include "mysql.h"
+#include "mysql_version.h"
+#include "mysqld_error.h"
#include <my_sys.h>
#include <mysys_err.h>
#include <m_string.h>
#include <m_ctype.h>
-#include "mysql.h"
-#include "mysql_version.h"
-#include "mysqld_error.h"
-#include "errmsg.h"
+#include <my_net.h>
+#include <errmsg.h>
#include <violite.h>
#include <sys/stat.h>
#include <signal.h>
-#include <time.h>
#include <errno.h>
-#ifdef HAVE_PWD_H
-#include <pwd.h>
+#if defined(OS2)
+# include <sys/un.h>
+#elif !defined( __WIN__)
+#include <sys/resource.h>
+#ifdef HAVE_SYS_UN_H
+# include <sys/un.h>
#endif
-#if !defined(MSDOS) && !defined(__WIN__)
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
#include <netdb.h>
#ifdef HAVE_SELECT_H
# include <select.h>
@@ -48,18 +47,13 @@
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
-#endif
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h>
-#endif
-#if defined(THREAD) && !defined(__WIN__)
-#include <my_pthread.h> /* because of signal() */
-#endif
+#include <sys/utsname.h>
+#endif /* __WIN__ */
+
#ifndef INADDR_NONE
#define INADDR_NONE -1
#endif
-
#define RES_BUF_SHIFT 5
#define SOCKET_ERROR -1
#define NET_BUF_SIZE 2048
diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh
index 24dee288706..b743e228a0f 100644
--- a/scripts/make_binary_distribution.sh
+++ b/scripts/make_binary_distribution.sh
@@ -70,7 +70,7 @@ for i in extra/comp_err extra/replace extra/perror extra/resolveip \
client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin \
client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest \
client/.libs/mysqlcheck \
- client/.libs/mysqlmanagerc client/libs/mysqlmanager-pwgen \
+ client/.libs/mysqlmanagerc client/.libs/mysqlmanager-pwgen \
tools/.libs/mysqlmanager
do
if [ -f $i ]
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index ca9c0bae682..65b130bfd82 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -77,9 +77,7 @@ extern "C" { // Because of SCO 3.2V4.2
#include <sys/select.h>
#endif
#include <sys/utsname.h>
-#else
-#include <windows.h>
-#endif // __WIN__
+#endif /* __WIN__ */
#ifdef HAVE_LIBWRAP
#include <tcpd.h>
diff --git a/tools/mysqlmanager.c b/tools/mysqlmanager.c
index f2f89c6bc07..9cb04505e2f 100644
--- a/tools/mysqlmanager.c
+++ b/tools/mysqlmanager.c
@@ -88,6 +88,8 @@
#define MAX_LAUNCHER_MSG 256
#endif
+#define MAX_RETRY_COUNT 100
+
/* Variable naming convention - if starts with manager_, either is set
directly by the user, or used closely in ocnjunction with a variable
set by the user
@@ -1161,10 +1163,15 @@ static char* read_line(struct manager_thd* thd)
{
int len,read_len;
char *block_end,*p_back;
+ uint retry_count=0;
+
read_len = min(NET_BLOCK,(uint)(buf_end-p));
- if ((len=vio_read(thd->vio,p,read_len))<=0)
+ while ((len=vio_read(thd->vio,p,read_len))<=0)
{
- log_err("Error reading command from client");
+ if (vio_should_retry(thd->vio) && retry_count++ < MAX_RETRY_COUNT)
+ continue;
+ log_err("Error reading command from client (Error: %d)",
+ vio_errno(thd->vio));
thd->fatal=1;
return 0;
}