Don't panic on weird infix garbage

Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com>
This commit is contained in:
Jamie Brandon 2019-05-15 12:22:57 +01:00 committed by Nikhil Benesch
parent 908082d26f
commit 143846d333
No known key found for this signature in database
GPG key ID: F7386C5DEADABA7F
2 changed files with 10 additions and 1 deletions

View file

@ -209,6 +209,15 @@ fn parse_not() {
//TODO: add assertions
}
#[test]
fn parse_invalid_infix_not() {
let res = parse_sql_statements("SELECT c FROM t WHERE c NOT (");
assert_eq!(
ParserError::ParserError("Expected IN or BETWEEN after NOT, found: (".to_string()),
res.unwrap_err(),
);
}
#[test]
fn parse_collate() {
let sql = "SELECT name COLLATE \"de_DE\" FROM customer";