Skip to content

Add file-driven test cases for the clause-level MySQL 26.7 sweep - #43

Merged
kyleconroy merged 1 commit into
mainfrom
claude/validate-open-issues-jgyf11
Aug 20, 2026
Merged

Add file-driven test cases for the clause-level MySQL 26.7 sweep#43
kyleconroy merged 1 commit into
mainfrom
claude/validate-open-issues-jgyf11

Conversation

@kyleconroy

Copy link
Copy Markdown
Contributor

Summary

The first coverage sweep (#38) probed the MySQL 26.7 reference manual at statement-family granularity (Chapter 15, SQL Statements), which #39#42 then implemented. This PR is the second sweep at the next level of granularity: each Chapter 15 statement's full syntax diagram (every optional clause), Chapter 14 function-specific syntax, Chapter 11 lexical features, Chapter 13 type and column-attribute grammar, Chapter 10 §10.9 optimizer hints, and Chapter 26 partitioning.

Roughly 930 documented statements were probed against the parser. The 148 that fail to parse are recorded as error goldens in twelve new testdata/parser groups, following the #38 convention: when a statement gains support, its -- error segment turns into a Restore() golden and the diff makes the coverage change explicit.

New test groups

Group Gaps documented
mysql_unsupported_types INVISIBLE/VISIBLE column attribute (incl. the GIPK SHOW CREATE TABLE round-trip and ALTER ... SET VISIBLE), column-level ENGINE_ATTRIBUTE, DEFAULT (expr) with operators (only bare function calls parse today)
mysql_unsupported_functions JSON_TABLE, JSON_VALUE RETURNING/ON EMPTY/ON ERROR, CAST ... AT TIME ZONE, CAST AS NCHAR, SOUNDS LIKE
mysql_unsupported_routines every CREATE PROCEDURE characteristic (COMMENT, LANGUAGE SQL, DETERMINISTIC, CONTAINS/NO SQL, READS/MODIFIES SQL DATA, SQL SECURITY), LANGUAGE JAVASCRIPT bodies with dollar-quoted strings, CREATE LIBRARY $$-bodies and the USING clause
mysql_unsupported_account IDENTIFIED BY RANDOM PASSWORD, multi-factor auth (AND IDENTIFIED, ADD/MODIFY/DROP n FACTOR, registration flow), dual-password clauses (REPLACE/RETAIN CURRENT PASSWORD/DISCARD OLD PASSWORD), DEFAULT ROLE on CREATE/ALTER USER, PASSWORD REQUIRE CURRENT, GRANT ... AS user WITH ROLE, GRANT role WITH ADMIN OPTION, REVOKE IF EXISTS/IGNORE UNKNOWN USER, REVOKE PROXY, SET PASSWORD TO RANDOM
mysql_unsupported_admin histogram USING DATA and AUTO/MANUAL UPDATE, INSTALL COMPONENT SET PERSIST, DROP RESOURCE GROUP FORCE, SET RESOURCE GROUP ... FOR, FLUSH OPTIMIZER_COSTS/RELAY LOGS/USER_RESOURCES/TABLES FOR EXPORT/multi-option lists, SET PERSIST/PERSIST_ONLY
mysql_unsupported_show SHOW STORAGE ENGINES, SHOW WARNINGS/ERRORS LIMIT, SHOW EXTENDED INDEX, SHOW REPLICA STATUS FOR CHANNEL
mysql_unsupported_ddl AUTOEXTEND_SIZE, CREATE TABLE ... START TRANSACTION, CREATE INDEX ENGINE_ATTRIBUTE, ALTER DATABASE READ ONLY, WITH CHECK OPTION without a CASCADED/LOCAL qualifier
mysql_unsupported_dml INTO OUTFILE ... CHARACTER SET, multiple locking clauses, INTO before a locking clause, derived-table column lists, LOAD DATA CONCURRENT/PARTITION/IGNORE n ROWS
mysql_unsupported_txn BEGIN/COMMIT/ROLLBACK WORK, START TRANSACTION characteristic lists, LOCK TABLES aliases and LOW_PRIORITY WRITE
mysql_unsupported_replication CHANGE REPLICATION SOURCE options with non-literal values (IGNORE_SERVER_IDS, PRIVILEGE_CHECKS_USER, REQUIRE_TABLE_PRIMARY_KEY_CHECK, ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS), RESET BINARY LOGS AND GTIDS TO
mysql_unsupported_compound DECLARE ... CONDITION, the LOOP statement
mysql_unsupported_utility EXPLAIN FORMAT=TREE (bare keyword), EXPLAIN ... INTO @var, DESCRIBE tbl 'wildcard'

The goldens also capture every parse gap tracked by the open issues (#14, #15, #17#21, #23, #28#30), so those fixes will surface in test diffs automatically.

What came back clean

Optimizer hints (the entire §10.9 hint surface), lexical structure (Chapter 11, except dollar quoting), character sets (Chapter 12), partitioning (Chapter 26), and most of the type grammar all parse — they contributed no groups. Probes that turned out to be invalid or obsolete syntax (NOT MEMBER OF, HANDLER ... READ LAST without an index, RENAME TABLES, SHOW MASTER LOGS, DISABLE ON SLAVE) were excluded rather than recorded as gaps.

Test plan

  • go test ./... -count=1 -timeout 120s passes with the new groups
  • Every case in the new groups is an error golden (verified none silently parse)

🤖 Generated with Claude Code

https://claude.ai/code/session_01LUq2EgtMGE5ARXusR8mvDY


Generated by Claude Code

The first coverage sweep (#38) probed the MySQL 26.7 reference manual at
statement-family granularity (Chapter 15), which #39-#42 then implemented.
This second sweep walks the remaining grammar surface: each Chapter 15
statement's full syntax diagram (every optional clause), Chapter 14
function-specific syntax, Chapter 11 lexical features, Chapter 13 type and
column-attribute grammar, Chapter 10 optimizer hints, and Chapter 26
partitioning. Roughly 930 documented statements were probed; the 148 that
fail to parse are recorded as error goldens in twelve new testdata groups:

- mysql_unsupported_types: INVISIBLE/VISIBLE column attribute (including
  the GIPK SHOW CREATE TABLE round-trip and ALTER ... SET VISIBLE),
  column-level ENGINE_ATTRIBUTE, and DEFAULT (expr) with operators
  (only bare function calls currently parse)
- mysql_unsupported_functions: JSON_TABLE, JSON_VALUE RETURNING /
  ON EMPTY / ON ERROR, CAST ... AT TIME ZONE, CAST AS NCHAR, SOUNDS LIKE
- mysql_unsupported_routines: every CREATE PROCEDURE characteristic
  (COMMENT, LANGUAGE SQL, DETERMINISTIC, CONTAINS/NO SQL, READS/MODIFIES
  SQL DATA, SQL SECURITY), LANGUAGE JAVASCRIPT bodies with dollar-quoted
  strings, and CREATE LIBRARY $$-bodies with the USING clause
- mysql_unsupported_account: IDENTIFIED BY RANDOM PASSWORD, multi-factor
  auth (AND IDENTIFIED, ADD/MODIFY/DROP n FACTOR, registration flow),
  dual-password clauses (REPLACE / RETAIN CURRENT PASSWORD / DISCARD OLD
  PASSWORD), DEFAULT ROLE on CREATE/ALTER USER, PASSWORD REQUIRE CURRENT,
  GRANT ... AS user WITH ROLE, GRANT role WITH ADMIN OPTION, REVOKE
  IF EXISTS / IGNORE UNKNOWN USER, REVOKE PROXY, SET PASSWORD TO RANDOM
- mysql_unsupported_admin: histogram USING DATA and AUTO/MANUAL UPDATE,
  INSTALL COMPONENT SET PERSIST, DROP RESOURCE GROUP FORCE, SET RESOURCE
  GROUP ... FOR, FLUSH OPTIMIZER_COSTS / RELAY LOGS / USER_RESOURCES /
  TABLES FOR EXPORT / multi-option lists, and SET PERSIST / PERSIST_ONLY
- mysql_unsupported_show: SHOW STORAGE ENGINES, SHOW WARNINGS/ERRORS
  LIMIT, SHOW EXTENDED INDEX, SHOW REPLICA STATUS FOR CHANNEL
- mysql_unsupported_ddl: AUTOEXTEND_SIZE, CREATE TABLE ... START
  TRANSACTION, CREATE INDEX ENGINE_ATTRIBUTE, ALTER DATABASE READ ONLY,
  and WITH CHECK OPTION without a CASCADED/LOCAL qualifier
- mysql_unsupported_dml: INTO OUTFILE ... CHARACTER SET, multiple locking
  clauses, INTO before a locking clause, derived-table column lists,
  LOAD DATA CONCURRENT / PARTITION / IGNORE n ROWS
- mysql_unsupported_txn: BEGIN/COMMIT/ROLLBACK WORK, START TRANSACTION
  characteristic lists, LOCK TABLES aliases and LOW_PRIORITY WRITE
- mysql_unsupported_replication: CHANGE REPLICATION SOURCE options with
  non-literal values (IGNORE_SERVER_IDS, PRIVILEGE_CHECKS_USER,
  REQUIRE_TABLE_PRIMARY_KEY_CHECK, ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS)
  and RESET BINARY LOGS AND GTIDS TO
- mysql_unsupported_compound: DECLARE ... CONDITION and the LOOP statement
- mysql_unsupported_utility: EXPLAIN FORMAT=TREE (bare keyword),
  EXPLAIN ... INTO @var, DESCRIBE tbl 'wildcard'

The goldens document current behavior: when a statement gains support,
its -- error segment turns into a Restore() golden and the diff makes the
coverage change explicit. Chapters 10, 11 (except dollar quoting), 12, 26,
and the hint sub-parser probes all passed and contributed no new groups.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LUq2EgtMGE5ARXusR8mvDY
@kyleconroy
kyleconroy merged commit 833245b into main Aug 20, 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