From 301b1b63abd6a19dd766ddd5f452a107ea92c6d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 20 Jun 2019 09:17:31 +0300 Subject: [PATCH] MXS-2569: Always terminate schemas with newlines If the stored file didn't have a newline in the schema, the schema and the first row would be on the same line. --- server/modules/routing/avrorouter/avro_client.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/modules/routing/avrorouter/avro_client.cc b/server/modules/routing/avrorouter/avro_client.cc index 1ff7a2515..a847353e6 100644 --- a/server/modules/routing/avrorouter/avro_client.cc +++ b/server/modules/routing/avrorouter/avro_client.cc @@ -586,6 +586,8 @@ GWBUF* read_avro_json_schema(std::string avrofile, std::string dir) std::stringstream ss; ss << file.rdbuf(); std::string text = ss.str(); + mxs::rtrim(text); + text += '\n'; mxs::Buffer buffer(std::vector(text.begin(), text.end())); rval = buffer.release(); }