summaryrefslogtreecommitdiff
path: root/sql/my_json_writer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/my_json_writer.cc')
-rw-r--r--sql/my_json_writer.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/my_json_writer.cc b/sql/my_json_writer.cc
index 4f933583347..7a3dc776093 100644
--- a/sql/my_json_writer.cc
+++ b/sql/my_json_writer.cc
@@ -218,7 +218,8 @@ bool Single_line_formatting_helper::on_start_array()
}
else
{
- state= INACTIVE;
+ if (state != DISABLED)
+ state= INACTIVE;
// TODO: what if we have accumulated some stuff already? shouldn't we
// flush it?
return false; // not handled
@@ -313,6 +314,9 @@ void Single_line_formatting_helper::flush_on_one_line()
void Single_line_formatting_helper::disable_and_flush()
{
+ if (state == DISABLED)
+ return;
+
bool start_array= (state == IN_ARRAY);
state= DISABLED;
// deactivate ourselves and flush all accumulated calls.