Add file-driven test cases for the clause-level MySQL 26.7 sweep - #43
Merged
Conversation
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
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.
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/parsergroups, following the #38 convention: when a statement gains support, its-- errorsegment turns into aRestore()golden and the diff makes the coverage change explicit.New test groups
mysql_unsupported_typesINVISIBLE/VISIBLEcolumn attribute (incl. the GIPKSHOW CREATE TABLEround-trip andALTER ... SET VISIBLE), column-levelENGINE_ATTRIBUTE,DEFAULT (expr)with operators (only bare function calls parse today)mysql_unsupported_functionsJSON_TABLE,JSON_VALUERETURNING/ON EMPTY/ON ERROR,CAST ... AT TIME ZONE,CAST AS NCHAR,SOUNDS LIKEmysql_unsupported_routinesCREATE PROCEDUREcharacteristic (COMMENT,LANGUAGE SQL,DETERMINISTIC,CONTAINS/NO SQL,READS/MODIFIES SQL DATA,SQL SECURITY),LANGUAGE JAVASCRIPTbodies with dollar-quoted strings,CREATE LIBRARY$$-bodies and theUSINGclausemysql_unsupported_accountIDENTIFIED 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 ROLEon 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 RANDOMmysql_unsupported_adminUSING DATAandAUTO/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_ONLYmysql_unsupported_showSHOW STORAGE ENGINES,SHOW WARNINGS/ERRORS LIMIT,SHOW EXTENDED INDEX,SHOW REPLICA STATUS FOR CHANNELmysql_unsupported_ddlAUTOEXTEND_SIZE,CREATE TABLE ... START TRANSACTION,CREATE INDEX ENGINE_ATTRIBUTE,ALTER DATABASE READ ONLY,WITH CHECK OPTIONwithout aCASCADED/LOCALqualifiermysql_unsupported_dmlINTO OUTFILE ... CHARACTER SET, multiple locking clauses,INTObefore a locking clause, derived-table column lists,LOAD DATA CONCURRENT/PARTITION/IGNORE n ROWSmysql_unsupported_txnBEGIN/COMMIT/ROLLBACK WORK,START TRANSACTIONcharacteristic lists,LOCK TABLESaliases andLOW_PRIORITY WRITEmysql_unsupported_replicationCHANGE REPLICATION SOURCEoptions 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 TOmysql_unsupported_compoundDECLARE ... CONDITION, theLOOPstatementmysql_unsupported_utilityEXPLAIN 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 LASTwithout an index,RENAME TABLES,SHOW MASTER LOGS,DISABLE ON SLAVE) were excluded rather than recorded as gaps.Test plan
go test ./... -count=1 -timeout 120spasses with the new groups🤖 Generated with Claude Code
https://claude.ai/code/session_01LUq2EgtMGE5ARXusR8mvDY
Generated by Claude Code