mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-11465 JSON_LENGTH returns incorrect length.
Item_func_json_length::val_int fixed.
This commit is contained in:
@@ -292,3 +292,12 @@ json_depth('[[], {}]')
|
|||||||
select json_depth('[[[1,2,3],"s"], {}, []]');
|
select json_depth('[[[1,2,3],"s"], {}, []]');
|
||||||
json_depth('[[[1,2,3],"s"], {}, []]')
|
json_depth('[[[1,2,3],"s"], {}, []]')
|
||||||
4
|
4
|
||||||
|
select json_length('');
|
||||||
|
json_length('')
|
||||||
|
NULL
|
||||||
|
select json_length('{}');
|
||||||
|
json_length('{}')
|
||||||
|
0
|
||||||
|
select json_length('[1, 2, {"a": 3}]');
|
||||||
|
json_length('[1, 2, {"a": 3}]')
|
||||||
|
3
|
||||||
|
@@ -129,3 +129,6 @@ select json_depth(cast(NULL as JSON));
|
|||||||
select json_depth('[[], {}]');
|
select json_depth('[[], {}]');
|
||||||
select json_depth('[[[1,2,3],"s"], {}, []]');
|
select json_depth('[[[1,2,3],"s"], {}, []]');
|
||||||
|
|
||||||
|
select json_length('');
|
||||||
|
select json_length('{}');
|
||||||
|
select json_length('[1, 2, {"a": 3}]');
|
||||||
|
@@ -1271,8 +1271,7 @@ longlong Item_func_json_length::val_int()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return length;
|
return length - 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user