Description
The HELP output documents status as a connection command ("Show connection status"), and the REPL's isCompleteStatement() recognizes it as a simple command. However:
- Bare
STATUS fails with parse error because STATUS is a lexer keyword, not IDENTIFIER, so it doesn't match helpStatement: IDENTIFIER (identifierOrKeyword)*
SHOW STATUS parses (grammar has showOrList STATUS) but produces no output — the visitor's ExitShowStatement only checks for STATUS inside the CATALOG branch, never routing to StatusStmt
- The
ExitHelpStatement case "status" at visitor_query.go:1036 is dead code
Steps to Reproduce
# Via -c
mxcli -c "STATUS"
# Parse error: extraneous input 'STATUS'
# Via pipe
echo "SHOW STATUS" | mxcli -p project.mpr
# Connected to: ... (no status output)
Expected
STATUS or SHOW STATUS should print connection status (path, version, module count) as documented in HELP.
Root Cause
STATUS token (lexer keyword) doesn't match IDENTIFIER in helpStatement rule
ExitShowStatement visitor has no branch for bare ctx.STATUS() (only ctx.CATALOG() + ctx.STATUS())
execStatus() in executor_connect.go:105-123 is functional but unreachable
Affected Files
mdl/grammar/MDLParser.g4 — needs standalone STATUS in utilityStatement or route via showStatement
mdl/visitor/visitor_query.go — ExitShowStatement missing STATUS branch; ExitHelpStatement case "status" is dead
mdl/repl/repl.go:294 — lists "status" in simpleCommands (correct intent)
Description
The HELP output documents
statusas a connection command ("Show connection status"), and the REPL'sisCompleteStatement()recognizes it as a simple command. However:STATUSfails with parse error becauseSTATUSis a lexer keyword, notIDENTIFIER, so it doesn't matchhelpStatement: IDENTIFIER (identifierOrKeyword)*SHOW STATUSparses (grammar hasshowOrList STATUS) but produces no output — the visitor'sExitShowStatementonly checks forSTATUSinside theCATALOGbranch, never routing toStatusStmtExitHelpStatementcase"status"atvisitor_query.go:1036is dead codeSteps to Reproduce
Expected
STATUSorSHOW STATUSshould print connection status (path, version, module count) as documented in HELP.Root Cause
STATUStoken (lexer keyword) doesn't matchIDENTIFIERinhelpStatementruleExitShowStatementvisitor has no branch for barectx.STATUS()(onlyctx.CATALOG() + ctx.STATUS())execStatus()inexecutor_connect.go:105-123is functional but unreachableAffected Files
mdl/grammar/MDLParser.g4— needs standaloneSTATUSinutilityStatementor route viashowStatementmdl/visitor/visitor_query.go—ExitShowStatementmissing STATUS branch;ExitHelpStatementcase "status" is deadmdl/repl/repl.go:294— lists "status" insimpleCommands(correct intent)