From 06968763243583d8909a38c5685f5e98e504cd56 Mon Sep 17 00:00:00 2001 From: Rohan Yadav Date: Thu, 30 May 2019 13:59:24 -0400 Subject: [PATCH] sql: Add parser support for a show indexes from database command Progress on the command requested in #37270. Release note (sql change): Add frontend support for a command that shows all indexes of all tables in a database. --- pkg/sql/parser/sql.y | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/sql/parser/sql.y b/pkg/sql/parser/sql.y index 1e7e4975897e..3d9956fae740 100644 --- a/pkg/sql/parser/sql.y +++ b/pkg/sql/parser/sql.y @@ -3347,7 +3347,7 @@ show_grants_stmt: // %Help: SHOW INDEXES - list indexes // %Category: DDL -// %Text: SHOW INDEXES FROM +// %Text: SHOW INDEXES FROM { | DATABASE } // %SeeAlso: WEBDOCS/show-index.html show_indexes_stmt: SHOW INDEX FROM table_name @@ -3355,15 +3355,27 @@ show_indexes_stmt: $$.val = &tree.ShowIndexes{Table: $4.unresolvedObjectName()} } | SHOW INDEX error // SHOW HELP: SHOW INDEXES +| SHOW INDEX FROM DATABASE database_name + { + return unimplementedWithIssue(sqllex, 37270) + } | SHOW INDEXES FROM table_name { $$.val = &tree.ShowIndexes{Table: $4.unresolvedObjectName()} } +| SHOW INDEXES FROM DATABASE database_name + { + return unimplementedWithIssue(sqllex, 37270) + } | SHOW INDEXES error // SHOW HELP: SHOW INDEXES | SHOW KEYS FROM table_name { $$.val = &tree.ShowIndexes{Table: $4.unresolvedObjectName()} } +| SHOW KEYS FROM DATABASE database_name + { + return unimplementedWithIssue(sqllex, 37270) + } | SHOW KEYS error // SHOW HELP: SHOW INDEXES // %Help: SHOW CONSTRAINTS - list constraints