From 1c733bf4501d897206e5e5786be3c8b6091f536e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 15 Aug 2018 12:44:25 +0300 Subject: [PATCH] MXS-2015: Always check for error responses As a JSON object can never start with the ERR prefix, it is safe to check it for all requests. Also fixed the missing newline in the avrorouter error message. --- connectors/cdc-connector/cdc_connector.cpp | 2 +- server/modules/routing/avrorouter/avro_client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connectors/cdc-connector/cdc_connector.cpp b/connectors/cdc-connector/cdc_connector.cpp index be751488a..9286aeff4 100644 --- a/connectors/cdc-connector/cdc_connector.cpp +++ b/connectors/cdc-connector/cdc_connector.cpp @@ -584,7 +584,7 @@ bool Connection::read_row(std::string& dest) m_buf_ptr = m_buffer.begin(); } - if (!m_connected && is_error(dest.c_str())) + if (is_error(dest.c_str())) { rval = false; } diff --git a/server/modules/routing/avrorouter/avro_client.c b/server/modules/routing/avrorouter/avro_client.c index bc454477d..13eb037ba 100644 --- a/server/modules/routing/avrorouter/avro_client.c +++ b/server/modules/routing/avrorouter/avro_client.c @@ -484,7 +484,7 @@ avro_client_process_command(AVRO_INSTANCE *router, AVRO_CLIENT *client, GWBUF *q } else { - dcb_printf(client->dcb, "ERR REQUEST-DATA with no data"); + dcb_printf(client->dcb, "ERR REQUEST-DATA with no data\n"); } } /* Return last GTID info */