From ad4c65cf16a12299a6f3a478d16f5014a67b00bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 19 Jan 2017 23:06:38 +0000 Subject: [PATCH] transaction_persistent could disable routing after commit #889 If transaction_persistent is enabled and some query would disable multiplexing, for example "SELECT @@hostname", query routing was still disabled even after the transaction has committed --- lib/MySQL_Session.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 1ed64180e..ca3de7e80 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2333,6 +2333,10 @@ handler_again: if (myds->myconn->IsActiveTransaction()==true) { // only active transaction is important here. Ignore other criterias transaction_persistent_hostgroup=current_hostgroup; } + } else { + if (myds->myconn->IsActiveTransaction()==false) { // a transaction just completed + transaction_persistent_hostgroup=-1; + } } } }