Skip to content

[Bug]: JSON_TABLE VARCHAR column with CHARACTER SET utf8mb4 fails to parse, blocking LangGraph checkpoint reads #29914

Closed

Description

@dengn

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

dd38098

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 channels

Its 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

  1. added
    kind/bug
    on Oct 11, 2026
  2. added
    severity/s0
    on Oct 26, 2026
  3. added a commit that references this issue on Oct 27, 2026
    537b014
  4. assigned and unassigned on Oct 27, 2026
  5. slyunnn commented on Oct 28, 2026

    @slyunnn

    Regression and extended verification for #29914 (2026-10-28)

    Verification Environment

    • MatrixOne latest origin/main: 66c9e7624e3374897acc649195fde5b2836343a5 — fix: widen integer addition and multiplication (#31088). The fresh mo-service binary reports this exact vcs.revision with vcs.modified=false; git_version() returned 66c9e76 through every route.
    • Fresh local 2 CN / 1 TN / 1 Log service / Proxy topology. Endpoints: Proxy 6001, CN1 16001, CN2 16002; all were reachable before and after testing.
    • PyMySQL over the MySQL text protocol; PREPARE/EXECUTE were server-side SQL statements, not binary COM_STMT_* calls.

    What Was Covered

    • OK — The original JSON_TABLE query with VARCHAR(150) CHARACTER SET utf8mb4 returned alpha and beta on Proxy, CN1, and CN2.
    • OK — Plain VARCHAR without a charset declaration retained the same result; VARCHAR(1) with utf8mb4 preserved Chinese and emoji characters and their HEX values.
    • OK — Unsupported latin1 was rejected even with an empty JSON input; the connection remained usable.
    • OK — The correlated JSON_KEYS(checkpoint, '$.channel_versions') query returned the expected per-checkpoint channel set, including Unicode keys, on all 3 routes.
    • OK — Server-side SQL PREPARE/EXECUTE reused the charset-decorated query for Chinese and emoji values on all 3 routes.
    • Not covered — Re-running an external MySQL 8.4 control, unmodified LangGraph application code, or binary COM_STMT_PREPARE/COM_STMT_EXECUTE.

    Findings

    • The associated fix is MatrixOne PR #31284, merged as 537b014ecb2031013b64ff67f96041688f25be38. It admits supported UTF-8 charset declarations in JSON_TABLE column types and preserves their type metadata.
    • The reported parser error at CHARACTER SET utf8mb4 did not reproduce on the exact current main runtime. No MatrixOne service source was changed.

    MOTR / BVT Coverage

    • Existing MatrixOne BVT: 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 invoke mo-tester.
    • No new MOTR case, issue branch, commit, or PR was created because the distinct SQL contract is already present in the focused upstream BVT.

    Final Conclusion

    Fixed for the reported JSON_TABLE ... CHARACTER SET utf8mb4 SQL and correlated checkpoint-read query on the exact current main runtime. 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions