Fix parsing of COLLATE after parentheses in expressions (#507)

This commit is contained in:
Riccardo Azzolini 2022-05-25 22:10:38 +02:00 committed by GitHub
parent 901f5b974f
commit 0fa812bd2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 10 deletions

View file

@ -561,6 +561,15 @@ fn parse_collate() {
);
}
#[test]
fn parse_collate_after_parens() {
let sql = "SELECT (name) COLLATE \"de_DE\" FROM customer";
assert_matches!(
only(&all_dialects().verified_only_select(sql).projection),
SelectItem::UnnamedExpr(Expr::Collate { .. })
);
}
#[test]
fn parse_select_string_predicate() {
let sql = "SELECT id, fname, lname FROM customer \