mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-24 08:43:43 +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!(),
|
||||
};
|
||||
|
||||
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!(
|
||||
*except,
|
||||
ExceptSelectItem {
|
||||
fist_elemnt: Ident::new("col1"),
|
||||
additional_elements: vec![Ident::new("col2")]
|
||||
}
|
||||
)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
},
|
||||
_ => unreachable!(),
|
||||
},
|
||||
_ => unreachable!(),
|
||||
};
|
||||
assert_eq!(
|
||||
bigquery_and_generic()
|
||||
.parse_sql_statements("SELECT * EXCEPT () FROM employee_table")
|
||||
.unwrap_err()
|
||||
.to_string(),
|
||||
"sql parser error: Expected identifier, found: )"
|
||||
);
|
||||
}
|
||||
|
||||
fn bigquery() -> TestedDialects {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue