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
JSON_CONTAINS is not implemented. Prisma's MySQL connector compiles JSON where filters ({ path, equals }, array_contains, string_contains) into JSON_CONTAINS, so those filters fail at runtime. JSON storage/retrieval, JSON_EXTRACT, and JSON_SET all work fine — only JSON_CONTAINS is missing.
Steps to Reproduce
SELECT JSON_CONTAINS('{"tags":["x","y"]}', '"x"', '$.tags');
-- ERROR 20105 (HY000): not supported: function or operator 'json_contains'
ConnectorError(... MysqlError { code: 20105,
message: "not supported: function or operator 'json_contains'", state: "HY000" })
Note
Related JSON functions JSON_ARRAY / JSON_OBJECT are also unsupported on v3.0.11 (they DO work on the 4.0-dev line). JSON_CONTAINS is unsupported on both v3.0.11 and 4.0-dev.
Expected Behavior
MySQL implements JSON_CONTAINS.
Test context — Found while testing Prisma ORM (v5.22) compatibility against MatrixOne. Reproduced on both:
Prod cloud — 8.0.30-MatrixOne-v3.0.11
4.0 dev line — nightly-0bfda604 (select version() → 8.0.30-MatrixOne-v)
(Results on the older v3.0.5 are intentionally omitted.)
Activity
daviszhen commentedon Jul 9, 2026
fixed
Ariznawlll commentedon Jul 13, 2026
已在最新
main完成函数白盒、原始复现和 Prisma 风格 protocol prepared 详细验证,结果通过。验证环境
2865ed6cc8a39727b8b274bb52b88fe441d0b30cselect git_version()已核对一致2037cc82a/ add json_contains #25478database/sql+go-sql-driver/mysql v1.8.1interpolateParams=false、单物理连接,参数查询实际走COM_STMT_PREPARE / COM_STMT_EXECUTE白盒测试
执行:
两个 package 均通过,未发现 race。矩阵覆盖:
9007199254740993、uint64 max精度边界原始 SQL
预期:
1;实际:1。不再返回not supported。Prisma 风格 protocol prepared 矩阵
测试表:
同一个 prepared SQL:
逐次参数与结果:
"doc", path=$.type→[1]"x", path=$.tags→[1]["y"], path=$.tags→[1,2]{"a":1}, path=$.nested→[1]"missing", path=$.tags→[]1, path=$.missing→[]六次均在 5 秒 deadline 内正常返回,statement 可连续复用;SQL NULL 行未被误判为 contains。
结论:原始不支持问题已修复,Prisma
{ path, equals }/ array containment 依赖的 protocol prepared 参数路径也可正常执行。