Support the MySQL SHOW statement variants - #40
Merged
Conversation
Implement the mysql_unsupported_show statement coverage group (MySQL 26.7 §15.7.7): its error goldens turn into Restore() goldens and the group is renamed to mysql_show with expanded coverage, following the mysql_admin precedent. Grammar, written from the reference manual since these statements postdate the goyacc grammar (parser/parse_show.go): - SHOW BINARY LOGS, joining the existing SHOW BINARY LOG STATUS branch - SHOW BINLOG EVENTS and SHOW RELAYLOG EVENTS with the shared [IN 'log'] [FROM pos] [LIMIT [offset,] count] [FOR CHANNEL 'ch'] tail (parseShowLogEventsTail); the LIMIT clause reuses SelectStmtLimit and the existing ShowStmt.Limit field - SHOW REPLICAS - SHOW ENGINE engine_name STATUS | MUTEX; the engine name is an identifier or string literal - SHOW CREATE EVENT/FUNCTION/TRIGGER/LIBRARY (qualified names allowed) and SHOW CREATE MASKING POLICY; FUNCTION uses the Procedure field like SHOW CREATE PROCEDURE, MASKING POLICY stores its name in DBName like SHOW CREATE PLACEMENT POLICY - SHOW FUNCTION CODE and SHOW PROCEDURE CODE, branching off the existing FUNCTION/PROCEDURE STATUS targets - SHOW LIBRARY STATUS with ShowLikeOrWhereOpt - SHOW PARSE_TREE, whose argument MySQL limits to a select statement (reuses finishSelectFamily, including the WITH form) The removed SHOW MASTER LOGS spelling stays unsupported, matching MySQL 8.4+, and SHOW ENGINE ... LOGS stays unsupported; both are recorded as error goldens. AST: fifteen new ShowStmtType values with Restore cases and SEMCommand strings, and new backwards-compatible ShowStmt fields Engine, LogName, Position, ChannelName, and ParseTreeStmt (visited by Accept). Keyword tables: CODE, LIBRARY, MUTEX, PARSE_TREE, and RELAYLOG become unreserved keywords, matching their MySQL 26.7 classification; TestKeywordsLength counts updated accordingly. testdata/errors.json is unaffected. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZ64iRBArJZJ4XAtwLM9X6
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.
Implement the
mysql_unsupported_showstatement coverage group (MySQL 26.7 §15.7.7): its error goldens turn intoRestore()goldens and the group is renamed tomysql_showwith expanded coverage (38 cases), following themysql_adminprecedent.Grammar
Written from the reference manual since these statements postdate the goyacc grammar (
parser/parse_show.go):SHOW BINARY LOGS, joining the existingSHOW BINARY LOG STATUSbranchSHOW BINLOG EVENTSandSHOW RELAYLOG EVENTSwith the shared[IN 'log'] [FROM pos] [LIMIT [offset,] count] [FOR CHANNEL 'ch']tail (parseShowLogEventsTail); the LIMIT clause reusesSelectStmtLimitand the existingShowStmt.LimitfieldSHOW REPLICASSHOW ENGINE engine_name STATUS | MUTEX; the engine name is an identifier or string literalSHOW CREATE EVENT/FUNCTION/TRIGGER/LIBRARY(qualified names allowed) andSHOW CREATE MASKING POLICY; FUNCTION uses theProcedurefield likeSHOW CREATE PROCEDURE, MASKING POLICY stores its name inDBNamelikeSHOW CREATE PLACEMENT POLICYSHOW FUNCTION CODEandSHOW PROCEDURE CODE, branching off the existing FUNCTION/PROCEDURE STATUS targetsSHOW LIBRARY STATUSwithShowLikeOrWhereOptSHOW PARSE_TREE, whose argument MySQL limits to a select statement (reusesfinishSelectFamily, including the WITH form)The removed
SHOW MASTER LOGSspelling stays unsupported, matching MySQL 8.4+, andSHOW ENGINE ... LOGSstays unsupported; both are recorded as error goldens.AST
Fifteen new
ShowStmtTypevalues with Restore cases and SEMCommand strings, and new backwards-compatibleShowStmtfieldsEngine,LogName,Position,ChannelName, andParseTreeStmt(visited byAccept).Keyword tables
CODE,LIBRARY,MUTEX,PARSE_TREE, andRELAYLOGbecome unreserved keywords, matching their MySQL 26.7 classification;TestKeywordsLengthcounts updated accordingly.testdata/errors.jsonis unaffected, and regenerating all goldens confirmed no other test group shifted.🤖 Generated with Claude Code
https://claude.ai/code/session_01BZ64iRBArJZJ4XAtwLM9X6
Generated by Claude Code