summaryrefslogtreecommitdiff
path: root/sql/item_jsonfunc.cc
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2017-03-20 15:18:06 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2017-03-20 15:18:06 +0400
commit76f6c1e1ed2c48594832e20035cd15fec9c35d94 (patch)
tree4689c538b1e9a40042d5e46b339c644dac674725 /sql/item_jsonfunc.cc
parenta06da5c848e6feeef0b1559e84479890a76c446e (diff)
downloadmariadb-git-76f6c1e1ed2c48594832e20035cd15fec9c35d94.tar.gz
MDEV-12262 Assertion `!null_value' failed in virtual bool Item::send on
JSON_REMOVE. null_value wasn't properly set in Item_json_func_remove::val_str.
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r--sql/item_jsonfunc.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index f3090a4097f..b8471dc8244 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -2633,6 +2633,7 @@ v_found:
str->length(0);
if (append_simple(str, js->ptr(), rem_start - js->ptr()) ||
+ (je.state == JST_KEY && n_item > 0 && str->append(",", 1)) ||
append_simple(str, rem_end, js->end() - rem_end))
goto js_error; /* Out of memory. */
@@ -2658,6 +2659,7 @@ v_found:
if (json_nice(&je, str, Item_func_json_format::LOOSE))
goto js_error;
+ null_value= 0;
return str;
js_error: