Details
-
Bug
-
Status: Confirmed (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.0, 13.1
Description
Data-corruption grade: same root cause as M4 (32-bit truncation) but affecting the four edit/check functions JSON_SET/REPLACE/REMOVE/CONTAINS_PATH — modifying data at the wrong position. (Note: negative indices $[-1] counting from the end is a documented MariaDB extension that MySQL rejects — not a bug.)
SELECT JSON_SET('[10,20,30]', '$[4294967297]', 99); |
-- MariaDB: [10, 99, 30] <-- 2^32+1 wraps to index 1, value inserted at the wrong position! |
SELECT JSON_REPLACE('[10,20,30]', '$[4294967297]', 99); -- [10, 99, 30] replaced in the wrong place |
SELECT JSON_REMOVE('[10,20,30]', '$[4294967297]'); -- [10, 30] wrong element deleted |
SELECT JSON_CONTAINS_PATH('[10,20,30]','one','$[4294967297]'); -- 1 (considers it existing) |
-- MySQL: all raise ERROR 3143 Invalid JSON path expression |
Attachments
Issue Links
- relates to
-
MDEV-40971 JSON Path Array Index 32-bit Integer Truncation Wraparound ( [ 2 3 2 + n ] ≡ [2 3 2+n]≡[n])
-
- Confirmed
-