feat: Support KILL statement (#479)

This commit is contained in:
Dmitry Patsura 2022-05-02 21:04:33 +03:00 committed by GitHub
parent 7732c34b19
commit f5980cd30f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 109 additions and 0 deletions

View file

@ -770,6 +770,36 @@ fn parse_substring_in_select() {
}
}
#[test]
fn parse_kill() {
let stmt = mysql_and_generic().verified_stmt("KILL CONNECTION 5");
assert_eq!(
stmt,
Statement::Kill {
modifier: Some(KillType::Connection),
id: 5,
}
);
let stmt = mysql_and_generic().verified_stmt("KILL QUERY 5");
assert_eq!(
stmt,
Statement::Kill {
modifier: Some(KillType::Query),
id: 5,
}
);
let stmt = mysql_and_generic().verified_stmt("KILL 5");
assert_eq!(
stmt,
Statement::Kill {
modifier: None,
id: 5,
}
);
}
fn mysql() -> TestedDialects {
TestedDialects {
dialects: vec![Box::new(MySqlDialect {})],