diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 15e97c42d..1fa2aa355 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -1343,8 +1343,10 @@ __exit_DSS__STATE_NOT_INITIALIZED: if (mybe && mybe->server_myds) { if (mybe->server_myds->DSS > STATE_MARIADB_BEGIN && mybe->server_myds->DSS < STATE_MARIADB_END) { +#ifdef DEBUG MySQL_Data_Stream *myds=mybe->server_myds; MySQL_Connection *myconn=mybe->server_myds->myconn; +#endif /* DEBUG */ proxy_debug(PROXY_DEBUG_MYSQL_CONNECTION, 5, "Sess=%p, status=%d, server_myds->DSS==%d , revents==%d , async_state_machine=%d\n", this, status, mybe->server_myds->DSS, myds->revents, myconn->async_state_machine); } else { diff --git a/lib/MySQL_Thread.cpp b/lib/MySQL_Thread.cpp index 8cbaa2fe2..62b9e2ca7 100644 --- a/lib/MySQL_Thread.cpp +++ b/lib/MySQL_Thread.cpp @@ -1576,7 +1576,9 @@ void MySQL_Thread::run() { if (myds==NULL) { if (mypolls.fds[n].revents) { unsigned char c; - read(mypolls.fds[n].fd, &c, 1); // read just one byte , no need for error handling + if (read(mypolls.fds[n].fd, &c, 1)==-1) {// read just one byte + proxy_error("Error during read from signal_all_threads()\n"); + } proxy_debug(PROXY_DEBUG_GENERIC,3, "Got signal from admin , done nothing\n"); //fprintf(stderr,"Got signal from admin , done nothing\n"); // FIXME: this is just the scheleton for issue #253 if (c) { @@ -2191,7 +2193,9 @@ void MySQL_Threads_Handler::signal_all_threads(unsigned char _c) { for (i=0;ipipefd[1]; - write(fd,&c,1); + if (write(fd,&c,1)==-1) { + proxy_error("Error during write in signal_all_threads()\n"); + } } } diff --git a/lib/debug.cpp b/lib/debug.cpp index 2d2e04224..ebf856f9a 100644 --- a/lib/debug.cpp +++ b/lib/debug.cpp @@ -9,8 +9,10 @@ #endif /* DEBUG_EXTERN */ #endif /* DEBUG */ +#ifdef DEBUG static unsigned long long pretime=0; static spinlock debug_spinlock; +#endif /* DEBUG */ static inline unsigned long long debug_monotonic_time() { struct timespec ts; diff --git a/lib/mysql_connection.cpp b/lib/mysql_connection.cpp index 535ae652c..d31b4e28b 100644 --- a/lib/mysql_connection.cpp +++ b/lib/mysql_connection.cpp @@ -701,7 +701,9 @@ handler_again: void MySQL_Connection::next_event(MDB_ASYNC_ST new_st) { +#ifdef DEBUG int fd; +#endif /* DEBUG */ wait_events=0; if (async_exit_status & MYSQL_WAIT_READ) @@ -709,9 +711,15 @@ void MySQL_Connection::next_event(MDB_ASYNC_ST new_st) { if (async_exit_status & MYSQL_WAIT_WRITE) wait_events|= POLLOUT; if (wait_events) +#ifdef DEBUG fd= mysql_get_socket(mysql); +#else + mysql_get_socket(mysql); +#endif /* DEBUG */ else +#ifdef DEBUG fd= -1; +#endif /* DEBUG */ if (async_exit_status & MYSQL_WAIT_TIMEOUT) { timeout=10000; //tv.tv_sec= 0;