mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-27972: Unexpected behavior with negative zero (-0) in
JSON Path Analysis: When we have '-' followed by 0, then the state is changed to JE_SYN, meaning syntax error. Fix: Change the state to PS_INT instead, because we are reading '0' next (integer) and it is not a syntax error.
This commit is contained in:
@@ -2013,5 +2013,21 @@ SELECT JSON_VALUE(@json, '$.A[last-1][last-1].key1');
|
||||
JSON_VALUE(@json, '$.A[last-1][last-1].key1')
|
||||
123
|
||||
#
|
||||
# MDEV-27972: Unexpected behavior with negative zero (-0) in JSON Path
|
||||
#
|
||||
SET @json='{ "x": [0,1]}';
|
||||
SELECT JSON_VALUE(@json,'$.x[last]');
|
||||
JSON_VALUE(@json,'$.x[last]')
|
||||
1
|
||||
SELECT JSON_VALUE(@json,'$.x[last-0]');
|
||||
JSON_VALUE(@json,'$.x[last-0]')
|
||||
1
|
||||
SELECT JSON_VALUE(@json,'$.x[-0]');
|
||||
JSON_VALUE(@json,'$.x[-0]')
|
||||
0
|
||||
SELECT JSON_VALUE(@json,'$.x[0]');
|
||||
JSON_VALUE(@json,'$.x[0]')
|
||||
0
|
||||
#
|
||||
# End of 10.9 Test
|
||||
#
|
||||
|
Reference in New Issue
Block a user