mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-31 19:27:21 +00:00
Support DROP TEMPORARY TABLE
, MySQL syntax (#916)
This commit is contained in:
parent
10a6ec5637
commit
eb4be98980
4 changed files with 40 additions and 1 deletions
|
@ -1597,3 +1597,29 @@ fn parse_string_introducers() {
|
|||
fn parse_div_infix() {
|
||||
mysql().verified_stmt(r#"SELECT 5 DIV 2"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_drop_temporary_table() {
|
||||
let sql = "DROP TEMPORARY TABLE foo";
|
||||
match mysql().verified_stmt(sql) {
|
||||
Statement::Drop {
|
||||
object_type,
|
||||
if_exists,
|
||||
names,
|
||||
cascade,
|
||||
purge: _,
|
||||
temporary,
|
||||
..
|
||||
} => {
|
||||
assert!(!if_exists);
|
||||
assert_eq!(ObjectType::Table, object_type);
|
||||
assert_eq!(
|
||||
vec!["foo"],
|
||||
names.iter().map(ToString::to_string).collect::<Vec<_>>()
|
||||
);
|
||||
assert!(!cascade);
|
||||
assert!(temporary);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue