Repository navigation
Description
Is there an existing issue for the same bug?
Checked repository issue searches for JSON_TABLE with CHARACTER SET / charset; no narrow report was found. Related umbrella: #28036. This report isolates a remaining grammar gap after the bounded JSON_TABLE implementation (#28924), rather than claiming JSON_TABLE is entirely unsupported.
Branch Name
main
Commit ID
Other Environment Information
- Freshly compiled mo-service from the commit above, isolated local LOG/TN/CN deployment.
- SELECT version(), git_version(): 8.0.30-MatrixOne-v; dd38098.
- MySQL control: official mysql:8.4 Docker image (digest sha256:6ea90827b1100f8f2ae306a539f86d2c264a26ed435a2a9f75551dd5c3aeb242).
- Driver: PyMySQL 1.2.3, Python 3.12.
- Application reproducer: langgraph-checkpoint-mysql 3.0.0 with langgraph 1.2.14.
Actual Behavior
JSON_TABLE now accepts basic typed columns, including VARCHAR, but rejects a VARCHAR column decorated with CHARACTER SET utf8mb4.
SELECT jt.channel
FROM JSON_TABLE(
'["alpha","beta"]', '$[*]'
COLUMNS(channel VARCHAR(150) CHARACTER SET utf8mb4 PATH '$')
) AS jt
ORDER BY jt.channel;MatrixOne returns error 1064, at CHARACTER SET:
SQL parser error ... syntax error at line 1 column 99 near " CHARACTER SET utf8mb4 PATH '$')) AS jt ORDER BY jt.channel"
Expected Behavior
The same statement on MySQL 8.4 succeeds and returns alpha, beta. A supported string-column charset declaration should be admitted and respected, or its limitation should be explicitly documented for JSON_TABLE.
Controls
Both of these succeed on the same MatrixOne service and the same MySQL control:
SELECT jt.n
FROM JSON_TABLE('[1,2]', '$[*]' COLUMNS(n INT PATH '$')) AS jt
ORDER BY jt.n;
SELECT jt.channel
FROM JSON_TABLE('["alpha","beta"]', '$[*]'
COLUMNS(channel VARCHAR(150) PATH '$')) AS jt
ORDER BY jt.channel;This isolates the rejection to the CHARACTER SET clause, not JSON parsing, array expansion, VARCHAR admission, or general JSON_TABLE availability.
Application Impact
The community LangGraph MySQL checkpoint saver generates:
json_table(
json_keys(checkpoint, '$.channel_versions'),
'$[*]' columns (channel VARCHAR(150) CHARACTER SET utf8mb4 PATH '$')
) as channelsIts setup and graph checkpoint read path are usable on MySQL; the read path fails on MatrixOne. This blocks graph execution/state restoration with the unmodified community saver.
Suspected Area and Suggested Regression Coverage
The JSON_TABLE typed-column grammar currently uses column_type followed directly by PATH. The CHARACTER SET decoration is not admitted there. This is a hypothesis from reading mysql_sql.y, not a product fix.
Cover explicit utf8mb4, ordinary VARCHAR without decoration, Unicode strings, connection charset interaction, and the actual correlated json_keys(checkpoint, ...) query used by the saver. The short read-only reproducer above has no schema/data mutation.
Activity
fix(sql): support UTF-8 charset declarations in JSON_TABLE (#31284)
slyunnn commentedon Oct 28, 2026
Regression and extended verification for #29914 (2026-10-28)
Verification Environment
origin/main:66c9e7624e3374897acc649195fde5b2836343a5—fix: widen integer addition and multiplication (#31088). The freshmo-servicebinary reports this exactvcs.revisionwithvcs.modified=false;git_version()returned66c9e76through every route.2 CN / 1 TN / 1 Log service / Proxytopology. Endpoints: Proxy6001, CN116001, CN216002; all were reachable before and after testing.PREPARE/EXECUTEwere server-side SQL statements, not binaryCOM_STMT_*calls.What Was Covered
JSON_TABLEquery withVARCHAR(150) CHARACTER SET utf8mb4returnedalphaandbetaon Proxy, CN1, and CN2.VARCHARwithout a charset declaration retained the same result;VARCHAR(1)withutf8mb4preserved Chinese and emoji characters and theirHEXvalues.latin1was rejected even with an empty JSON input; the connection remained usable.JSON_KEYS(checkpoint, '$.channel_versions')query returned the expected per-checkpoint channel set, including Unicode keys, on all3routes.PREPARE/EXECUTEreused the charset-decorated query for Chinese and emoji values on all3routes.8.4control, unmodified LangGraph application code, or binaryCOM_STMT_PREPARE/COM_STMT_EXECUTE.Findings
537b014ecb2031013b64ff67f96041688f25be38. It admits supported UTF-8 charset declarations inJSON_TABLEcolumn types and preserves their type metadata.CHARACTER SET utf8mb4did not reproduce on the exact currentmainruntime. No MatrixOne service source was changed.MOTR / BVT Coverage
test/distributed/cases/function/table_func_json_table.sql, including charset, Unicode, negative, correlated, and prepared cases. This run independently exercised the public SQL path but did not invokemo-tester.Final Conclusion
Fixed for the reported
JSON_TABLE ... CHARACTER SET utf8mb4SQL and correlated checkpoint-read query on the exact currentmainruntime. Large-data regression is not needed: this was grammar/type admission and metadata, not a row-count, batch, spill, or concurrency boundary; the small Unicode and correlated datasets exercise the relevant contract.