Repository navigation
Conversation
Model the MySQL/MariaDB table maintenance statements as TableMaintenanceStatement with its operation, NO_WRITE_TO_BINLOG/LOCAL modifier, TABLE/TABLES spelling, table list and per-operation options. Options outside an operation's definition are rejected, and the option words remain ordinary identifiers elsewhere. Wire the statement into the deparser, table finder, validator and statement feature analysis, and keep a following CHECK TABLE statement out of CREATE DOMAIN's CHECK constraint loop. Signed-off-by: minleejae <mmj9808@gmail.com>
This was referenced Oct 13, 2026
This branch has not been deployed
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.
Purpose
Parse the MySQL/MariaDB table maintenance statements
CHECK TABLE,OPTIMIZE TABLEandREPAIR TABLE. They currently fail in every configuration, so tools that replicate or audit MySQL DDL cannot read, for example,OPTIMIZE TABLE t.ANALYZE TABLEfrom the same family is already modeled (#2542).Current design (As-is)
The statement grammar has no alternative for these statements.
CHECK,OPTIMIZEandREPAIRare only used inside other clauses, such as the ALTER TABLE partition actions.Target design (To-be)
TableMaintenanceStatement, which records:Operation(CHECK,OPTIMIZE,REPAIR);NO_WRITE_TO_BINLOG/LOCALmodifier;TABLEorTABLESwas written;CHECK:FOR UPGRADE,QUICK,FAST,MEDIUM,EXTENDEDandCHANGED.REPAIR:QUICK,EXTENDEDandUSE_FRM.OPTIMIZEandREPAIRtake a modifier.TABLEorTABLESfollows. LikeANALYZE, it is available in every dialect. ACHECK TABLEstatement that followsCREATE DOMAINis no longer read as part of the domain'sCHECKconstraint list; this was the only grammar choice conflict the new statement introduced.StatementDeParserandTablesNamesFinder;Feature.tableMaintenance, which the MySQL and MariaDB capabilities enable;READS_DATAandRETURNS_RESULT_SET; OPTIMIZE and REPAIR alsoMODIFIES_SCHEMA, and REPAIR possiblyMODIFIES_DATA.Validation
CREATE DOMAINfollowed byCHECK TABLE;spotlessApply check: 10,120 tests, 10,095 passed, 25 skipped, zero failures/errors. The grammar choice conflict check passes.CHECK NO_WRITE_TO_BINLOG TABLE,OPTIMIZE TABLE t QUICK,REPAIR TABLE t FASTandCHECK TABLE t USE_FRM.Integration validation
Applied #2788, #2789, #2790, #2791 and #2792 together on
master(166f0a27):spotlessApply check: 10,150 tests, 10,125 passed, 25 skipped, zero failures/errors.