Commit c605285b authored by Michael Okoko's avatar Michael Okoko Committed by Sergei Petrunia

fix returned value type for empty json objects

Signed-off-by: default avatarMichael Okoko <okokomichaels@outlook.com>
parent 69f24c23
......@@ -101,7 +101,7 @@ ERROR HY000: Failed to parse histogram, encountered JSON_TYPE '1'.
UPDATE mysql.column_stats SET histogram='{}' WHERE table_name='t1';
FLUSH TABLES;
SELECT * FROM t1;
ERROR HY000: Failed to parse histogram, encountered JSON_TYPE '32641'.
ERROR HY000: Failed to parse histogram, encountered JSON_TYPE '1'.
DELETE FROM mysql.column_stats;
DROP TABLE t1;
create schema world;
......
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment