From d20e130e010ced8cdc608c9ec7284b693a3def14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Tue, 13 Dec 2016 12:46:29 +0000 Subject: [PATCH] Fix bug #837 --- 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 772ab5558..70101edd4 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -2527,7 +2527,11 @@ handler_again: myconn->async_state_machine=ASYNC_IDLE; myds->DSS=STATE_MARIADB_GENERIC; if (transaction_persistent==true) { - transaction_persistent_hostgroup=current_hostgroup; + if (transaction_persistent_hostgroup==-1) { // change only if not set already, do not allow to change it again + if (myds->myconn->IsActiveTransaction()==true) { // only active transaction is important here. Ignore other criterias + transaction_persistent_hostgroup=current_hostgroup; + } + } } } } else {