Skip to content

Commit

Permalink
sql: Add parser support for a show indexes from database command
Browse files Browse the repository at this point in the history
Progress on the command requested in cockroachdb#37270.

Release note (sql change): Add frontend support for a command
that shows all indexes of all tables in a database.
  • Loading branch information
rohany committed Jun 3, 2019
1 parent c280de4 commit 9942478
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/sql/parser/sql.y
Original file line number Diff line number Diff line change
Expand Up @@ -3347,23 +3347,35 @@ show_grants_stmt:

// %Help: SHOW INDEXES - list indexes
// %Category: DDL
// %Text: SHOW INDEXES FROM <tablename>
// %Text: SHOW INDEXES FROM { <tablename> | DATABASE <database_name> }
// %SeeAlso: WEBDOCS/show-index.html
show_indexes_stmt:
SHOW INDEX FROM table_name
{
$$.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
Expand Down

0 comments on commit 9942478

Please sign in to comment.