Skip to content

fix(sql): support UTF-8 charset declarations in JSON_TABLE - #31284

Merged
XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
ck89119:issue-29914-main
Oct 27, 2026
Merged

XuPeng-SH merged 10 commits into
matrixorigin:mainfrom
ck89119:issue-29914-main

Conversation

@ck89119

@ck89119 ck89119 commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #29914

What this PR does / why we need it:

Allow CHARACTER SET utf8mb4 on JSON_TABLE character columns, unblocking the correlated JSON_KEYS(checkpoint, '$.channel_versions') query used by the LangGraph MySQL checkpoint saver.

  • Preserve charset declarations through parsing and formatting, and validate/apply their type metadata before DEFAULT admission and execution.
  • Support the existing UTF-8 domain and MatrixOne's utf8/utf8mb3 aliases. Other domains, including binary, remain explicitly unsupported rather than silently changing semantics.
  • Regenerate the parser and extend existing unit/BVT coverage for Unicode, session charset changes, prepared execution, nested/EXISTS columns, invalid declarations, and correlated checkpoint reads.

Validation on macOS arm64 with Go 1.27.1:

  • Full mysql-parser, AST, and planner package tests passed; changed handwritten executable blocks have 100% coverage.
  • gofmt, go vet, incremental golangci-lint, and mo-service build passed. Parser regeneration is conflict-free and reproducible.
  • table_func_json_table.sql passed twice on the same isolated service: 96/96 statements each, with database/stage cleanup verified.

@XuPeng-SH

XuPeng-SH commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: df78fa648e2df7b834f5cd83d6796892bd23f22e

Review completed. Read the assessment.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mo-bot review · mo-bot-local · review

Commit: df78fa648e2df7b834f5cd83d6796892bd23f22e

Assessment: approve

Reviewed the complete eight-file delta and affected consumers. Charset admission belongs in the existing JSON_TABLE binder and correctly precedes DEFAULT conversion, with consistent output and execution metadata. Existing charset and formatting helpers are reused without adding per-row work. No actionable defects or unresolved discussion concerns remain.

Model: gpt-6-astra / xhigh

Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1

Validation:

  • Reviewed parsing/formatting, aliases, invalid declarations, empty-input admission, nested/EXISTS columns, Unicode widths, session independence and correlated/prepared consumers.

  • Independent parser regeneration was conflict-free and byte-identical; parser-generation.log matches successful receipt checks/1793091996125554300-4.json.

  • Frozen exact-head CI records successful UT, SCA, coverage and both BVT groups. The author additionally reports parser/tree/planner passes and two focused 96/96 BVT runs.

  • Saved discussion-assessment.json covering both nonempty discussion entries; both are informational notices.

  • Reconciled commands, source fingerprints, exit receipts and retained logs in validation-audit.json. Final audit passed; source remained unchanged.

Limitations:

  • No local Go product tests ran: native prerequisites were absent and the repository owner rejected incompatible primary-worktree artifacts. This is an environment limitation, not a product-test failure.

  • CI raw logs and author execution receipts were not supplied; those results remain attributed evidence. The standalone linked-issue body was absent; review used the concrete contract and consumer query documented in the PR.

@mergify mergify Bot added the queued label Oct 27, 2026
@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

❌ Left the queue · Matrixone Coverage execution / Coverage fails with this pull request

58 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Tue 27 Oct, 09:12 · rule main · triggered by rule Automatic queue on approval for main
  • ❌ Checks failed · in place
  • 🚫 Left the queue 10:10 · 92a538e

The failure is in this pull request. It failed tested alone on top of main.

Reason

The merge conditions cannot be satisfied due to failing checks

  • CI Required

Failing checks:

To get back in the queue

  • Push a fix: the pull request is queued again once its queue conditions match.
  • If the failure is a flake, comment @mergifyio queue to queue it again as it is.
Merge conditions: 2 of 3 met

This pull request

Condition Required by
✅ #review-threads-unresolved = 0 GitHub branch protection
✅ github-review-approved GitHub branch protection

The batch, tested in place

Condition Required by
❌ any of: check-neutral = CI Required, check-skipped = CI Required, check-success = CI Required GitHub branch protection

Tick the box to put this pull request back in the merge queue (same as @mergifyio queue).

  • Requeue this pull request

Times in UTC · dashboard · how the merge queue works

@XuPeng-SH
XuPeng-SH merged commit 537b014 into matrixorigin:main Oct 27, 2026
4 of 5 checks passed

This branch was previously deployed

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

Labels

kind/bug Something isn't working size/XXL Denotes a PR that changes 2000+ lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants