mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-14 12:05:00 +00:00
feat: Support KILL statement (#479)
This commit is contained in:
parent
7732c34b19
commit
f5980cd30f
5 changed files with 109 additions and 0 deletions
|
@ -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 {})],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue