mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-27203: Valgrind / MSAN errors in Histogram_json_hb::parse_bucket
In read_bucket_endpoint(), handle all possible parser states.
This commit is contained in:
@ -4688,7 +4688,7 @@ explain select * from t1_json limit 1;
|
|||||||
id select_type table type possible_keys key key_len ref rows Extra
|
id select_type table type possible_keys key key_len ref rows Extra
|
||||||
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
|
1 SIMPLE t1_json ALL NULL NULL NULL NULL 10
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 4186 Failed to parse histogram for table test.t1_json: "size" element not present at offset 28.
|
Warning 4186 Failed to parse histogram for table test.t1_json: String or number expected at offset 27.
|
||||||
UPDATE mysql.column_stats
|
UPDATE mysql.column_stats
|
||||||
SET histogram='{"histogram_hb":[{"start":"aaa", "size":"not-an-integer"}]}'
|
SET histogram='{"histogram_hb":[{"start":"aaa", "size":"not-an-integer"}]}'
|
||||||
WHERE table_name='t1_json';
|
WHERE table_name='t1_json';
|
||||||
|
@ -480,6 +480,13 @@ bool read_bucket_endpoint(json_engine_t *je, Field *field, String *out,
|
|||||||
if (json_read_value(je))
|
if (json_read_value(je))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (je->value_type != JSON_VALUE_STRING &&
|
||||||
|
je->value_type != JSON_VALUE_NUMBER)
|
||||||
|
{
|
||||||
|
*err= "String or number expected";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
const char* je_value= (const char*)je->value;
|
const char* je_value= (const char*)je->value;
|
||||||
if (je->value_type == JSON_VALUE_STRING && je->value_escaped)
|
if (je->value_type == JSON_VALUE_STRING && je->value_escaped)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user