You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MySQL JSON APIs are unavailable or reject valid calls #28033
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
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.
changed the title [-][Compatibility]: MySQL JSON_ARRAY_INSERT, JSON_DEPTH, JSON_SEARCH, and JSON_MERGE are unavailable[/-][+]MySQL JSON APIs are unavailable or reject valid calls[/+]on Oct 23, 2026
Scope consolidation from #30471: this issue now covers the overlapping missing MySQL JSON APIs plus two additional gaps from the compatibility scan. The original missing APIs remain JSON_ARRAY_INSERT, JSON_DEPTH, JSON_SEARCH and JSON_MERGE; add JSON_ARRAY_APPEND (missing) and JSON_OBJECTAGG (recognized but rejects a valid key/value call). Keep each function's behavior and error/NULL contract as an independent acceptance case; this is a shared compatibility tracking scope, not a claim of one implementation root.
After implementation, validate each function independently with normal results, SQL NULL, malformed JSON/path inputs where applicable, argument validation, and prepared/CTAS forms where supported. The existing replacement-function controls and JSON_MERGE alias equivalence remain in scope.
Partial progress check on main c6683bd2f5 (2026-10-29, dual-CN local build), running the exact reproduction list from this issue:
API
status on current main
JSON_ARRAY([1,2]) families
working
JSON_DEPTH('{"a":[1]}')
working now — returns correct depth (verified JSON_DEPTH on {"a":1,"b":{"c":[true,null]}} → 4)
JSON_SEARCH('{"a":"x"}','one','x')
still missing — ERROR 20105: not supported: function or operator 'json_search'
JSON_MERGE / alias
not re-verified this round
JSON_ARRAY_INSERT
not re-verified this round (not tested)
So at least JSON_DEPTH landed since this report was filed; JSON_SEARCH remains the outstanding gap from the original list (any app doing content search inside JSON columns still has no path). If the team prefers, splitting the remaining items into a checklist or closing the fixed entries would make the residual work clearer.
Activity
VioletQwQ-0 commentedon Sep 4, 2026
已完成源码级 triage。
分析基线:
upstream/main@a6f3988587bdba967a75015a0a12f9bf3a2c9bac。needs-triage调整为severity/s1。四个兼容缺口均可稳定复现,本 Issue 已有负责人和近期实施计划;当前没有崩溃、数据损坏或发布阻断证据,因此不提升为 s0。JSON_MERGE_PATCH/PRESERVE,不覆盖废弃别名JSON_MERGE。issue #28033关联,在全部合并并完成 QA 前保持本 Issue 打开。实施与合入顺序:
JSON_MERGE:复用JSON_MERGE_PRESERVE,补 MySQL 1287 deprecated warning。JSON_DEPTH:补严格输入类型和 ByteJSON 深度遍历。JSON_ARRAY_INSERT:补专用数组插入操作,并使用统一 JSON constructor conversion。JSON_SEARCH:补携带真实 location 的字符串遍历、LIKE/escape、path filter 和去重。依赖门槛:
JSON_MERGE编码阶段等待 fix(json): preserve plain text in JSON_UNQUOTE #28090、fix(json): return escaped text from JSON_QUOTE #28091、[Feature] Support MySQL MEMBER OF JSON operator #28096 合并,避免函数注册和 binder 冲突。JSON_ARRAY_INSERT等待 fix(json): preserve MySQL binary subtype fidelity #28092 → fix(json): unify constructor value conversion #28093;fix(json): preserve arrayagg temporal and year values #28094 不是前置依赖。main开始,不基于未合入 head 堆叠。验证要求:
JSON_MERGE额外验证 1287 warning,JSON_SEARCH额外验证 prepared escape 和精确返回 path。fix(json): support JSON_MERGE compatibility alias (#28329)
fix(json): support JSON_MERGE compatibility alias (matrixorigin#28329)
fix(json): support JSON_MERGE compatibility alias (matrixorigin#28329)
feat(json): implement JSON_DEPTH (#28033) (#28962)
feat: support JSON_ARRAY_INSERT (#29519)
[-][Compatibility]: MySQL JSON_ARRAY_INSERT, JSON_DEPTH, JSON_SEARCH, and JSON_MERGE are unavailable[/-][+]MySQL JSON APIs are unavailable or reject valid calls[/+]XuPeng-SH commentedon Oct 23, 2026
Scope consolidation from #30471: this issue now covers the overlapping missing MySQL JSON APIs plus two additional gaps from the compatibility scan. The original missing APIs remain JSON_ARRAY_INSERT, JSON_DEPTH, JSON_SEARCH and JSON_MERGE; add JSON_ARRAY_APPEND (missing) and JSON_OBJECTAGG (recognized but rejects a valid key/value call). Keep each function's behavior and error/NULL contract as an independent acceptance case; this is a shared compatibility tracking scope, not a claim of one implementation root.
Additional repros from #30471:
After implementation, validate each function independently with normal results, SQL NULL, malformed JSON/path inputs where applicable, argument validation, and prepared/CTAS forms where supported. The existing replacement-function controls and JSON_MERGE alias equivalence remain in scope.
Ariznawlll commentedon Oct 29, 2026
Partial progress check on main
c6683bd2f5(2026-10-29, dual-CN local build), running the exact reproduction list from this issue:JSON_ARRAY([1,2])familiesJSON_DEPTH('{"a":[1]}')JSON_DEPTHon{"a":1,"b":{"c":[true,null]}}→ 4)JSON_SEARCH('{"a":"x"}','one','x')ERROR 20105: not supported: function or operator 'json_search'JSON_MERGE/ aliasJSON_ARRAY_INSERTSo at least
JSON_DEPTHlanded since this report was filed;JSON_SEARCHremains the outstanding gap from the original list (any app doing content search inside JSON columns still has no path). If the team prefers, splitting the remaining items into a checklist or closing the fixed entries would make the residual work clearer.