diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2020-10-22 15:51:14 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2020-10-22 15:51:14 +0400 |
commit | 21ea14db8cc8c5d88ff804650de7caf984d08a98 (patch) | |
tree | c8f021d2bf090d6eba9b4bbdfc3f9f322d26de6b /sql | |
parent | 620ea816adeceaba7c875679ab8505f4c07a22b8 (diff) | |
download | mariadb-git-21ea14db8cc8c5d88ff804650de7caf984d08a98.tar.gz |
MDEV-20593 SIGSEGV in report_json_error_ex (on optimized builds).
When first argument to the JSON_MERGE_PATCH was NULL and second - the
invalid JSON line, the error code was garbage. So it should be set to 0
initially.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_jsonfunc.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index b3c8366907a..7db1ae1ffaf 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -2429,6 +2429,8 @@ String *Item_func_json_merge_patch::val_str(String *str) uint n_arg; bool empty_result, merge_to_null; + /* To report errors properly if some JSON is invalid. */ + je1.s.error= je2.s.error= 0; merge_to_null= args[0]->null_value; for (n_arg=1; n_arg < arg_count; n_arg++) |