From 06ebc6f4b5f7f322198fc6cde23f5ae90a04fc03 Mon Sep 17 00:00:00 2001 From: vraatikka Date: Wed, 11 Dec 2013 14:34:01 +0200 Subject: [PATCH] Added QUERY_TYPE_GLOBAL_WRITE for writes which don't reflect on binary log, but need to be present in every back-end server once executed. --- query_classifier/query_classifier.cc | 19 ++++++++++++++++--- query_classifier/query_classifier.h | 3 ++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/query_classifier/query_classifier.cc b/query_classifier/query_classifier.cc index 3be29f1a2..621c497d2 100644 --- a/query_classifier/query_classifier.cc +++ b/query_classifier/query_classifier.cc @@ -418,14 +418,27 @@ static skygw_query_type_t resolve_query_type( * PRELOAD_KEYS, FLUSH, RESET, CREATE|ALTER|DROP SERVER */ if (sql_command_flags[lex->sql_command] & CF_AUTO_COMMIT_TRANS) { - qtype = QUERY_TYPE_SESSION_WRITE; - goto return_here; + if (lex->option_type == OPT_GLOBAL) + { + qtype = QUERY_TYPE_GLOBAL_WRITE; + } + else + { + qtype = QUERY_TYPE_SESSION_WRITE; + } + goto return_here; } /** Try to catch session modifications here */ switch (lex->sql_command) { - case SQLCOM_CHANGE_DB: case SQLCOM_SET_OPTION: + if (lex->option_type == OPT_GLOBAL) + { + qtype = QUERY_TYPE_GLOBAL_WRITE; + break; + } + /**