From a49433cc91ac567c0afa6182ef58e0c5a1347798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Wed, 6 Oct 2021 13:33:35 +0200 Subject: [PATCH] Manually set 'POLLOUT' event for 'SHOW_WARNINGS' session status to ensure sending by 'MySQL_Connection' #3606 --- lib/MySQL_Session.cpp | 7 +++++++ 1 file changed, 7 insertions(+) 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") );