diff options
Diffstat (limited to 'sql/item_jsonfunc.cc')
-rw-r--r-- | sql/item_jsonfunc.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc index 22c55066cdc..1dc511e8da9 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2016, 2021, MariaDB Corporation. +/* Copyright (c) 2016, 2022, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -591,10 +591,6 @@ bool Item_func_json_query::fix_length_and_dec() } -/* - Returns NULL, not an error if the found value - is not a scalar. -*/ bool Json_path_extractor::extract(String *str, Item *item_js, Item *item_jp, CHARSET_INFO *cs) { @@ -627,6 +623,9 @@ continue_search: if (json_read_value(&je)) return true; + if (je.value_type == JSON_VALUE_NULL) + return true; + if (unlikely(check_and_get_value(&je, str, &error))) { if (error) @@ -1109,7 +1108,6 @@ my_decimal *Item_func_json_extract::val_decimal(my_decimal *to) case JSON_VALUE_ARRAY: case JSON_VALUE_FALSE: case JSON_VALUE_UNINITALIZED: - // TODO: fix: NULL should be NULL case JSON_VALUE_NULL: int2my_decimal(E_DEC_FATAL_ERROR, 0, false/*unsigned_flag*/, to); return to; |