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.
This commit is contained in:
Markus Mäkelä 2019-06-20 09:17:31 +03:00
parent 7673ee685d
commit 301b1b63ab
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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<uint8_t>(text.begin(), text.end()));
rval = buffer.release();
}