From 7cc3f949b66af63d9b90666bcb6eafae881108fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Thu, 26 Sep 2019 23:51:47 +1000 Subject: [PATCH] Apply mysql_query_rules.destination_hostgroup also when unable to parse SET statement. It a SET statement wasn't parsed correctly, hostgroup was locked on current hostgroup and not on the hostgroup specified in mysql_query_rules.destination_hostgroup --- lib/MySQL_Session.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/MySQL_Session.cpp b/lib/MySQL_Session.cpp index 147f36509..bed925979 100644 --- a/lib/MySQL_Session.cpp +++ b/lib/MySQL_Session.cpp @@ -3221,6 +3221,11 @@ __get_pkts_from_client: if (locked_on_hostgroup < 0) { if (lock_hostgroup) { // we are locking on hostgroup now + if ( qpo->destination_hostgroup >= 0 ) { + if (transaction_persistent_hostgroup == -1) { + current_hostgroup=qpo->destination_hostgroup; + } + } locked_on_hostgroup = current_hostgroup; thread->status_variables.hostgroup_locked++; thread->status_variables.hostgroup_locked_set_cmds++;