From 3ed1b7ad4daaa7610ea2fa75ced19b5189a3639e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Mon, 7 Nov 2016 11:00:40 +0000 Subject: [PATCH] Handle error 1226 on connect #786 --- lib/MySQL_Session.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 19428d30c..5faf9ba6d 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -1114,6 +1114,14 @@ bool MySQL_Session::handler_again___status_CONNECTING_SERVER(int *_rc) { //wrong_pass=true; if (myds->connect_retries_on_failure >0 ) { myds->connect_retries_on_failure--; + int myerr=mysql_errno(myconn->mysql); + switch (myerr) { + case 1226: // ER_USER_LIMIT_REACHED , User '%s' has exceeded the '%s' resource (current value: %ld) + goto __exit_handler_again___status_CONNECTING_SERVER_with_err; + break; + default: + break; + } //myds->destroy_MySQL_Connection(); if (mirror) { PROXY_TRACE(); @@ -1121,6 +1129,7 @@ bool MySQL_Session::handler_again___status_CONNECTING_SERVER(int *_rc) { myds->destroy_MySQL_Connection_From_Pool(false); NEXT_IMMEDIATE_NEW(CONNECTING_SERVER); } else { +__exit_handler_again___status_CONNECTING_SERVER_with_err: int myerr=mysql_errno(myconn->mysql); if (myerr) { char sqlstate[10];