1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

fix returned value type for empty json objects

Signed-off-by: Michael Okoko <okokomichaels@outlook.com>
This commit is contained in:
Michael Okoko
2021-08-11 07:19:39 +01:00
committed by Sergei Petrunia
parent 69f24c238e
commit c605285bb8
2 changed files with 2 additions and 3 deletions

View File

@@ -1993,11 +1993,10 @@ bool json_get_array_items(const char *json, const char *json_end, int *value_typ
json_scan_start(&je, &my_charset_utf8mb4_bin, (const uchar *)json, (const uchar *)json_end);
if (json_read_value(&je) || je.value_type != JSON_VALUE_ARRAY)
if (json_read_value(&je) || (*value_type = je.value_type) != JSON_VALUE_ARRAY)
{
return false;
}
*value_type = je.value_type;
std::string val;
while(!json_scan_next(&je))