Skip to content

Support the MySQL 26.10 JSON duality view grammar - #47

Merged
kyleconroy merged 1 commit into
mainfrom
claude/project-thread-4nml7c
Dec 1, 2026
Merged

kyleconroy merged 1 commit into
mainfrom
claude/project-thread-4nml7c

Conversation

@kyleconroy

Copy link
Copy Markdown
Contributor

Requested by Kyle · project thread

Summary

marino targeted MySQL 26.7. The latest release is MySQL 26.10 (26.10.0 GA on 2026-10-20, then the 26.10.0.1 security patch on 2026-11-24). This PR brings the parser up to 26.10.

What changed in 26.10's grammar: Only JSON duality views changed (WL #17054). They gained table- and column-level CHECK / NO CHECK annotations and column-level UPDATE / NO UPDATE. The 26.10 keyword list adds only APPLIER_VERSION, APPLIER_WORKER_COUNT and APPLIER_EVENT_MEMORY_LIMIT, which marino already parses, and removes nothing. The reserved words are the same as in 26.7. VERSION_WITH_UPDATE() and @@version_with_update are new, but they are an ordinary function and system variable, so they already parsed.

The duality-view support from the 26.7 work had gaps. This PR implements the full 26.10 §15.1.17 grammar:

  • JSON_DUALITY_OBJECT(WITH (...) 'k' : col WITH (...), ...)
    • Table annotations: INSERT, UPDATE, DELETE, CHECK, and each one's NO form.
    • Column annotations.
    • A single annotation may be written without parentheses.
  • JSON_ARRAYAGG(... NULL ON NULL | ABSENT ON NULL), the nested-descendant form.
  • CREATE [ALGORITHM = ...] [DEFINER = ...] [SQL SECURITY ...] JSON [RELATIONAL] DUALITY VIEW. RELATIONAL is matched by spelling and stays a plain identifier elsewhere.

AST changes: All of them are additive, per the compatibility rule.

  • Annotations on JSONDualityObjectExpr and JSONDualityObjectItem.
  • NullClause on AggregateFuncExpr.
  • Algorithm, Definer and Security on CreateJSONDualityViewStmt, as pointers that are nil when the clause is absent, plus Relational.

Restore output for existing trees is unchanged.

CI and images: The repo has no MySQL Docker or CI images. Goldens come from Restore round trips, not a live server, so there was nothing to bump there.

Tests

  • New parser/testdata/parser/mysql_json_duality group with 18 cases.
    • The reference manual's examples.
    • The release note's annotation example.
    • Every annotation form, and the null clauses.
    • The view-option prefixes, and ALTER.
    • Three rejection cases.
  • go vet ./... and go test ./... -count=1 -timeout 120s pass.

Generated by Claude Code

MySQL 26.10 (latest release 26.10.0.1, 2026-11-24) adds table- and
column-level CHECK / NO CHECK and column-level UPDATE / NO UPDATE
annotations to JSON duality views (WL #17054). Its keyword list is
unchanged from 26.7, and no other statement grammar changed.

Bring marino's JSON duality views up to the 26.10 reference grammar
(§15.1.17):

- JSON_DUALITY_OBJECT(WITH (...) 'k' : v WITH (...), ...): table
  annotations (INSERT, UPDATE, DELETE, CHECK and their NO forms) and
  column annotations, with or without parentheses for a single value.
- JSON_ARRAYAGG(... NULL ON NULL | ABSENT ON NULL), the nested
  descendant form.
- CREATE [ALGORITHM = ...] [DEFINER = ...] [SQL SECURITY ...]
  JSON [RELATIONAL] DUALITY VIEW.

The ast changes are additive: new Annotations fields on
JSONDualityObjectExpr and JSONDualityObjectItem, NullClause on
AggregateFuncExpr, and Algorithm/Definer/Security/Relational on
CreateJSONDualityViewStmt. Restore output for existing trees is
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuRZ4KMjBgwfq79B6SzMKB
@kyleconroy kyleconroy self-assigned this Dec 1, 2026
@kyleconroy
kyleconroy merged commit 9b3af39 into main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants