From e26ec4f8b93a78546897959c1caadc2a457ab141 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 26 Jul 2017 22:25:36 +0300 Subject: [PATCH] MXS-1329: Only parse text protocol statements The query classifier should only be used to parse text protocol statements. The insertstream filter exploited the fact that any statements that the filter did not expect would be classified as an unknown commands. This led to repetitive error messages with binary protocol statements. --- server/modules/filter/insertstream/insertstream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/modules/filter/insertstream/insertstream.c b/server/modules/filter/insertstream/insertstream.c index 1b2c7b9b0..1c5eb9dca 100644 --- a/server/modules/filter/insertstream/insertstream.c +++ b/server/modules/filter/insertstream/insertstream.c @@ -574,7 +574,8 @@ static bool extract_insert_target(GWBUF *buffer, char* target, int len) { bool rval = false; - if (qc_get_operation(buffer) == QUERY_OP_INSERT && + if (MYSQL_GET_COMMAND(GWBUF_DATA(buffer)) == MYSQL_COM_QUERY && + qc_get_operation(buffer) == QUERY_OP_INSERT && only_implicit_values(buffer)) { int n_tables = 0;