Support parsing multiple show variables. (#290)

* feat: support parsing multiple show variables.

* fix: fix fmt error
This commit is contained in:
Francis Du 2021-02-10 04:03:49 +08:00 committed by GitHub
parent f40955ee82
commit 07342d5853
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 7 deletions

View file

@ -443,19 +443,19 @@ fn parse_set() {
#[test]
fn parse_show() {
let stmt = pg_and_generic().verified_stmt("SHOW a");
let stmt = pg_and_generic().verified_stmt("SHOW a a");
assert_eq!(
stmt,
Statement::ShowVariable {
variable: "a".into()
variable: vec!["a".into(), "a".into()]
}
);
let stmt = pg_and_generic().verified_stmt("SHOW ALL");
let stmt = pg_and_generic().verified_stmt("SHOW ALL ALL");
assert_eq!(
stmt,
Statement::ShowVariable {
variable: "ALL".into()
variable: vec!["ALL".into(), "ALL".into()]
}
)
}