summaryrefslogtreecommitdiff
path: root/sql/my_json_writer.cc
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2016-08-25 19:47:38 +0300
committerSergei Petrunia <psergey@askmonty.org>2016-08-25 19:47:38 +0300
commit2d65679384c36ae2e46b2f62538223c3d71fb00a (patch)
treeb0bffaac8c9063ed1b0e68fb775e13ea98352fd6 /sql/my_json_writer.cc
parent2024cddaa412e7c4a2aff8bb50907868155019da (diff)
downloadmariadb-git-2d65679384c36ae2e46b2f62538223c3d71fb00a.tar.gz
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).
Diffstat (limited to 'sql/my_json_writer.cc')
-rw-r--r--sql/my_json_writer.cc2
1 files changed, 2 insertions, 0 deletions
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;
}