Skip to content

Support the MySQL SHOW statement variants - #40

Merged
kyleconroy merged 1 commit into
mainfrom
claude/mysql-unsupported-show-2wy2d5
Aug 18, 2026
Merged

Support the MySQL SHOW statement variants#40
kyleconroy merged 1 commit into
mainfrom
claude/mysql-unsupported-show-2wy2d5

Conversation

@kyleconroy

Copy link
Copy Markdown
Contributor

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 (38 cases), 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, and regenerating all goldens confirmed no other test group shifted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BZ64iRBArJZJ4XAtwLM9X6


Generated by Claude Code

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
@kyleconroy
kyleconroy merged commit 429a60f into main Aug 18, 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