mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-11-03 00:31:20 +00:00
Add negative test for except clause on wildcards (#746)
This commit is contained in:
parent
01fd20f0a3
commit
650c53dc77
1 changed files with 7 additions and 21 deletions
|
|
@ -283,27 +283,13 @@ fn test_select_wildcard_with_except() {
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
match bigquery_and_generic().verified_stmt("SELECT * EXCEPT (col1, col2) FROM _table") {
|
|
||||||
Statement::Query(query) => match *query.body {
|
|
||||||
SetExpr::Select(select) => match &select.projection[0] {
|
|
||||||
SelectItem::Wildcard(WildcardAdditionalOptions {
|
|
||||||
opt_except: Some(except),
|
|
||||||
..
|
|
||||||
}) => {
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
*except,
|
bigquery_and_generic()
|
||||||
ExceptSelectItem {
|
.parse_sql_statements("SELECT * EXCEPT () FROM employee_table")
|
||||||
fist_elemnt: Ident::new("col1"),
|
.unwrap_err()
|
||||||
additional_elements: vec![Ident::new("col2")]
|
.to_string(),
|
||||||
}
|
"sql parser error: Expected identifier, found: )"
|
||||||
)
|
);
|
||||||
}
|
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
|
||||||
_ => unreachable!(),
|
|
||||||
},
|
|
||||||
_ => unreachable!(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bigquery() -> TestedDialects {
|
fn bigquery() -> TestedDialects {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue