From d1d8cb21ad2d72cf34b1ec17894680ecdceee590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Sat, 29 Dec 2018 01:01:08 +1100 Subject: [PATCH] Handle error 2019 If client tries to specify a charset that doesn't exist on backend, switch to default charset --- lib/MySQL_Session.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 76940bc46..c59e4e388 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2000,6 +2000,9 @@ bool MySQL_Session::handler_again___status_CHANGING_CHARSET(int *_rc) { // the command failed int myerr=mysql_errno(myconn->mysql); if (myerr >= 2000) { + if (myerr == 2019) { + client_myds->myconn->options.charset = mysql_thread___default_charset; + } bool retry_conn=false; // client error, serious proxy_error("Detected a broken connection during SET NAMES on %s , %d : %d, %s\n", myconn->parent->address, myconn->parent->port, myerr, mysql_error(myconn->mysql));