Repository navigation
Support the MySQL 26.10 JSON duality view grammar - #47
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 CHECKannotations and column-levelUPDATE/NO UPDATE. The 26.10 keyword list adds onlyAPPLIER_VERSION,APPLIER_WORKER_COUNTandAPPLIER_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_updateare 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 (...), ...)INSERT,UPDATE,DELETE,CHECK, and each one'sNOform.JSON_ARRAYAGG(... NULL ON NULL | ABSENT ON NULL), the nested-descendant form.CREATE [ALGORITHM = ...] [DEFINER = ...] [SQL SECURITY ...] JSON [RELATIONAL] DUALITY VIEW.RELATIONALis matched by spelling and stays a plain identifier elsewhere.AST changes: All of them are additive, per the compatibility rule.
AnnotationsonJSONDualityObjectExprandJSONDualityObjectItem.NullClauseonAggregateFuncExpr.Algorithm,DefinerandSecurityonCreateJSONDualityViewStmt, as pointers that are nil when the clause is absent, plusRelational.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
parser/testdata/parser/mysql_json_dualitygroup with 18 cases.ALTER.go vet ./...andgo test ./... -count=1 -timeout 120spass.Generated by Claude Code