matrixorigin / matrixorigin/matrixone

[Compatibility]: MySQL MEMBER OF JSON operator is rejected by the parser

Open
#28,035 2 comments 0 reactions 1 assignee Claimed by @VioletQwQ-0 View on GitHub
duplicate kind/bug
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

## Description

The MySQL JSON membership operator `value MEMBER OF(json_array)` is not accepted by the MatrixOne parser.

## Environment

- Branch: `main`
- Commit: `17c161a31b47a22e71ca222839143f66717ac365`
- Deployment: local single-node MatrixOne
- Test date: 2026-09-03

## Steps to reproduce

```sql
SELECT 17 MEMBER OF('[23, "abc", 17]');\n```\n\n## Actual behavior\n\nThe statement fails with a syntax error at `OF`.\n\n## Expected behavior\n\nMySQL returns `1` for a matching JSON-array element, `0` for a nonmatching element, and `NULL` when either operand is SQL `NULL`.\n\n## Stability and controls\n\n- Reproducer: parser rejection was identical in 3/3 rounds.\n- Control: `JSON_CONTAINS('{"a":"x"}', '"x"', '$.a')` returned `1` on the same service.\n- Failure atomicity: the reproducer is a read-only expression.\n\n## Evidence\n\nhttps://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html\n\n## Code analysis\n\nThe MySQL grammar and function registry contain no `MEMBER OF` implementation.\n\n## Regression coverage\n\nAfter implementation, add BVT cases for numeric/string/JSON values, no match, SQL `NULL`, malformed JSON, and predicates over JSON columns.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.