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

This commit is contained in:
Yoav Cohen 2025-07-17 11:24:14 +03:00 committed by GitHub
parent 92db20673b
commit 5f69df2693
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 1 deletions

View file

@ -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");