Skip to content

Commit

Permalink
Merge pull request #4824 from wubx/support-show-schemas
Browse files Browse the repository at this point in the history
Compatible: show schemas; synonym for show databases
  • Loading branch information
BohuTANG authored Apr 13, 2022
2 parents ba84e6b + 52f03db commit 698c025
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion query/src/sql/sql_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ impl<'a> DfParser<'a> {
self.parse_show_tables(full)
} else if self.consume_token("TABLE") && self.consume_token("STATUS") {
self.parse_show_tab_stat()
} else if self.consume_token("DATABASES") {
} else if self.consume_token("DATABASES") || self.consume_token("SCHEMAS") {
self.parse_show_databases()
} else if self.consume_token("SETTINGS") {
Ok(DfStatement::ShowSettings(DfShowSettings))
Expand Down
3 changes: 3 additions & 0 deletions tests/suites/0_stateless/06_show/06_0009_show_schemas.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ss
ss1
ss2
13 changes: 13 additions & 0 deletions tests/suites/0_stateless/06_show/06_0009_show_schemas.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
DROP DATABASE IF EXISTS ss;
DROP DATABASE IF EXISTS ss1;
DROP DATABASE IF EXISTS ss2;

CREATE DATABASE ss;
CREATE DATABASE ss1;
CREATE DATABASE ss2;

SHOW SCHEMAS like 'ss%';

DROP DATABASE IF EXISTS ss;
DROP DATABASE IF EXISTS ss1;
DROP DATABASE IF EXISTS ss2;

0 comments on commit 698c025

Please sign in to comment.