Commit 0ee9c83d authored by Donald H. (Donnie) Pinkston, III's avatar Donald H. (Donnie) Pinkston, III
Browse files

Add "SHOW '...' STATS" command back into parser

Somehow when upgrading the NanoDB parser to ANTLR4, I forgot to include
the SHOW STATS command.  This is essential for the storage lab, so of
course I added it back in as quickly as possible.
parent efef4169
No related merge requests found
Showing with 18 additions and 0 deletions
+18 -0
......@@ -43,6 +43,7 @@ commandNoSemicolon:
| showTablesStmt
| showPropsStmt
| setPropStmt
| showSystemStatsStmt
;
......@@ -204,6 +205,9 @@ rollbackTxnStmt:
//============================================================================
// Other utility statements
// SHOW PROPERTIES
// SET PROPERTY '...' = ...
// SHOW '...' STATS
// FLUSH
// CRASH
// EXIT (or QUIT)
......@@ -215,6 +219,9 @@ showPropsStmt:
setPropStmt:
SET PROPERTY name=STRING_LITERAL '=' expression ;
showSystemStatsStmt:
SHOW name=STRING_LITERAL STATS ;
flushStmt:
FLUSH ;
......
......@@ -5,6 +5,7 @@ import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import edu.caltech.nanodb.commands.ShowSystemStatsCommand;
import edu.caltech.nanodb.expressions.ArithmeticOperator;
import edu.caltech.nanodb.expressions.BooleanOperator;
import edu.caltech.nanodb.expressions.ColumnName;
......@@ -166,6 +167,16 @@ public class NanoSQLTranslator extends NanoSQLBaseVisitor<Object> {
(Expression) visit(ctx.expression()));
}
@Override
public Object visitShowSystemStatsStmt(NanoSQLParser.ShowSystemStatsStmtContext ctx) {
String systemName = ctx.name.getText();
// Remove the quotes from around the subsystem name
systemName = systemName.substring(1, systemName.length() - 1);
return new ShowSystemStatsCommand(systemName);
}
//=== TABLE/INDEX UTILITY COMMANDS =======================================
@Override
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment