From 14326774065fd211a79e5935414d149fb8a17660 Mon Sep 17 00:00:00 2001 From: Markus Makela Date: Mon, 21 Nov 2016 23:02:59 +0200 Subject: [PATCH] Fix regression in prepared statement routing The prepared statements were router according to the real type instead of being router to the master. This was caused by the change in the route target function. --- server/modules/routing/readwritesplit/readwritesplit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/modules/routing/readwritesplit/readwritesplit.c b/server/modules/routing/readwritesplit/readwritesplit.c index 62e3cf545..0bb306afc 100644 --- a/server/modules/routing/readwritesplit/readwritesplit.c +++ b/server/modules/routing/readwritesplit/readwritesplit.c @@ -1391,6 +1391,8 @@ static route_target_t get_route_target(ROUTER_CLIENT_SES *rses, else if (!trx_active && !load_active && !QUERY_IS_TYPE(qtype, QUERY_TYPE_MASTER_READ) && !QUERY_IS_TYPE(qtype, QUERY_TYPE_WRITE) && + !QUERY_IS_TYPE(qtype, QUERY_TYPE_PREPARE_STMT) && + !QUERY_IS_TYPE(qtype, QUERY_TYPE_PREPARE_NAMED_STMT) && (QUERY_IS_TYPE(qtype, QUERY_TYPE_READ) || QUERY_IS_TYPE(qtype, QUERY_TYPE_SHOW_TABLES) || QUERY_IS_TYPE(qtype, QUERY_TYPE_USERVAR_READ) ||