matrixorigin / matrixorigin/matrixone
[Compatibility]: MySQL JSON_ARRAY_INSERT, JSON_DEPTH, JSON_SEARCH, and JSON_MERGE are unavailable
- Dominant language
- Go
- Stars
- 1.9k
- Forks
- 311
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 768
Description
## Description
Four MySQL JSON APIs are absent on MatrixOne main: `JSON_ARRAY_INSERT`, `JSON_DEPTH`, `JSON_SEARCH`, and the deprecated-but-supported `JSON_MERGE` alias.
## Environment
- Branch: `main`
- Commit: `17c161a31b47a22e71ca222839143f66717ac365`
- Deployment: local single-node MatrixOne
- Test date: 2026-09-03
## Steps to reproduce
```sql
SELECT JSON_ARRAY_INSERT('[1,3]', '$[1]', 2);\nSELECT JSON_DEPTH('{"a":[1]}');\nSELECT JSON_SEARCH('{"a":"x"}', 'one', 'x');\nSELECT JSON_MERGE('{"a":1}', '{"a":2}');\n```\n\n## Actual behavior\n\nEach statement fails with `ERROR 20105: not supported: function or operator ...`.\n\n## Expected behavior\n\nMySQL 8.0 documents all four APIs. `JSON_MERGE` is deprecated in favor of `JSON_MERGE_PRESERVE`, but remains a supported compatibility alias.\n\n## Stability and controls\n\n- Reproducer: each statement failed identically in 3/3 rounds.\n- Controls: `JSON_ARRAY_APPEND`, `JSON_LENGTH`, `JSON_CONTAINS`, and `JSON_MERGE_PRESERVE` returned expected results on the same service.\n- Failure atomicity: all reproducers are read-only expressions.\n\n## Evidence\n\nhttps://dev.mysql.com/doc/refman/8.0/en/json-function-reference.html\n\n## Code analysis\n\n`pkg/sql/plan/function/function_id.go` has no registrations for these four names.\n\n## Regression coverage\n\nAfter implementation, add deterministic BVT cases for normal results, `NULL`, malformed JSON/path errors, and the `JSON_MERGE` alias equivalence.
Contributor guide
Assessment
This issue has not been assessed yet.