mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-24 08:43:43 +00:00
Add support for DROP USER
statement (#1951)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
This commit is contained in:
parent
92db20673b
commit
5f69df2693
3 changed files with 23 additions and 1 deletions
|
@ -8354,6 +8354,24 @@ fn parse_drop_view() {
|
|||
verified_stmt("DROP MATERIALIZED VIEW IF EXISTS a.b.c");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_drop_user() {
|
||||
let sql = "DROP USER u1";
|
||||
match verified_stmt(sql) {
|
||||
Statement::Drop {
|
||||
names, object_type, ..
|
||||
} => {
|
||||
assert_eq!(
|
||||
vec!["u1"],
|
||||
names.iter().map(ToString::to_string).collect::<Vec<_>>()
|
||||
);
|
||||
assert_eq!(ObjectType::User, object_type);
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
verified_stmt("DROP USER IF EXISTS u1");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_invalid_subquery_without_parens() {
|
||||
let res = parse_sql_statements("SELECT SELECT 1 FROM bar WHERE 1=1 FROM baz");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue