feat: add mysql show status statement (#1119)

Co-authored-by: Michael Ionov <michael@appdome.com>
This commit is contained in:
Michael Ionov 2024-02-04 15:52:46 +02:00 committed by GitHub
parent bcecd853f7
commit 61089f977c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 66 additions and 0 deletions

View file

@ -288,6 +288,36 @@ fn parse_show_columns() {
);
}
#[test]
fn parse_show_status() {
assert_eq!(
mysql_and_generic().verified_stmt("SHOW SESSION STATUS LIKE 'ssl_cipher'"),
Statement::ShowStatus {
filter: Some(ShowStatementFilter::Like("ssl_cipher".into())),
session: true,
global: false
}
);
assert_eq!(
mysql_and_generic().verified_stmt("SHOW GLOBAL STATUS LIKE 'ssl_cipher'"),
Statement::ShowStatus {
filter: Some(ShowStatementFilter::Like("ssl_cipher".into())),
session: false,
global: true
}
);
assert_eq!(
mysql_and_generic().verified_stmt("SHOW STATUS WHERE value = 2"),
Statement::ShowStatus {
filter: Some(ShowStatementFilter::Where(
mysql_and_generic().verified_expr("value = 2")
)),
session: false,
global: false
}
);
}
#[test]
fn parse_show_tables() {
assert_eq!(