diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 5e9e79272..da356ceea 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -4646,6 +4646,13 @@ handler_again: { MySQL_Data_Stream *myds=mybe->server_myds; MySQL_Connection *myconn=myds->myconn; + + // Setting POLLOUT is required just in case this state has been reached when 'RunQuery' from + // 'PROCESSING_QUERY' state has immediately return. This is because in case 'mysql_real_query_start' + // immediately returns with '0' the session is never processed again by 'MySQL_Thread', and 'revents' is + // never updated with the result of polling through the 'MySQL_Thread::mypolls'. + myds->revents |= POLLOUT; + int rc = myconn->async_query( mybe->server_myds->revents,(char *)"SHOW WARNINGS", strlen((char *)"SHOW WARNINGS") );