From 2d65679384c36ae2e46b2f62538223c3d71fb00a Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 25 Aug 2016 19:47:38 +0300 Subject: [PATCH] MDEV-10665: Json_writer produces extra members in output Fix an issue in Single_line_formatting_helper: flush_on_one_line() didn't clean up the buffered items which could cause them to be printed for the second time. This can't be ever observed by a user (see MDEV text for details). --- sql/my_json_writer.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/my_json_writer.cc b/sql/my_json_writer.cc index e97db210da7..d36fdd1192a 100644 --- a/sql/my_json_writer.cc +++ b/sql/my_json_writer.cc @@ -330,6 +330,8 @@ void Single_line_formatting_helper::flush_on_one_line() ptr++; } owner->output.append(']'); + /* We've printed out the contents of the buffer, mark it as empty */ + buf_ptr= buffer; }