mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 22:08:16 +00:00
add more consistency in ast (#523)
* add more consistency in ast * refactor styling
This commit is contained in:
parent
d981f70143
commit
c884fbc388
3 changed files with 43 additions and 15 deletions
|
@ -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(),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue