add more consistency in ast (#523)

* add more consistency in ast

* refactor styling
This commit is contained in:
Andrey Frolov 2022-06-15 00:02:03 +03:00 committed by GitHub
parent d981f70143
commit c884fbc388
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 15 deletions

View file

@ -3625,16 +3625,19 @@ fn parse_exists_subquery() {
let sql = "SELECT * FROM t WHERE EXISTS (SELECT 1)";
let select = verified_only_select(sql);
assert_eq!(
Expr::Exists(Box::new(expected_inner.clone())),
Expr::Exists {
negated: false,
subquery: Box::new(expected_inner.clone())
},
select.selection.unwrap(),
);
let sql = "SELECT * FROM t WHERE NOT EXISTS (SELECT 1)";
let select = verified_only_select(sql);
assert_eq!(
Expr::UnaryOp {
op: UnaryOperator::Not,
expr: Box::new(Expr::Exists(Box::new(expected_inner))),
Expr::Exists {
negated: true,
subquery: Box::new(expected_inner)
},
select.selection.unwrap(),
);