From 5d6debcb6505f41f7aa37372aae5a97ee58a5811 Mon Sep 17 00:00:00 2001 From: val Date: Mon, 6 Apr 2020 09:15:38 +0000 Subject: [PATCH 1/2] fix multi statement --- lib/MySQL_Session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 442697927..2cd23a908 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -1873,7 +1873,7 @@ bool MySQL_Session::handler_again___verify_backend_net_write_timeout() { } bool MySQL_Session::handler_again___verify_backend_multi_statement() { - if (client_myds->myconn->options.client_flag & CLIENT_MULTI_STATEMENTS != mybe->server_myds->myconn->options.client_flag & CLIENT_MULTI_STATEMENTS) { + if ((client_myds->myconn->options.client_flag & CLIENT_MULTI_STATEMENTS) != (mybe->server_myds->myconn->options.client_flag & CLIENT_MULTI_STATEMENTS)) { if (client_myds->myconn->options.client_flag & CLIENT_MULTI_STATEMENTS) mybe->server_myds->myconn->options.client_flag |= CLIENT_MULTI_STATEMENTS; From 07990f8a5704cdf476fa02068a5d6aca057d6689 Mon Sep 17 00:00:00 2001 From: val Date: Mon, 6 Apr 2020 13:30:49 +0000 Subject: [PATCH 2/2] Proper error reporting --- lib/MySQL_Session.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 2cd23a908..7f2cd16c4 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2607,7 +2607,11 @@ bool MySQL_Session::handler_again___status_SETTING_MULTI_STMT(int *_rc) { previous_status.pop(); NEXT_IMMEDIATE_NEW(st); } else { - proxy_error("Error setting multistatemnt on server\n"); + if (rc==-1) { + proxy_error("Error setting multistatement on server %s , %d : %d, %s\n", myconn->parent->address, myconn->parent->port, mysql_errno(myconn->mysql), mysql_error(myconn->mysql)); + } else { + // rc==1 , nothing to do for now + } } return ret; }