mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-03 22:08:16 +00:00
Don't silently accept naked OUTER JOINS
`SELECT * FROM a OUTER JOIN b` was previously being parsed as an inner join where table `a` was aliased to `OUTER`. This is extremely surprising, as the user likely intended to say FULL OUTER JOIN. Since the SQL specification lists OUTER as a keyword, we are well within our rights to return an error here.
This commit is contained in:
parent
7857543749
commit
2c99635709
3 changed files with 13 additions and 1 deletions
|
@ -1801,6 +1801,12 @@ fn parse_join_syntax_variants() {
|
|||
"SELECT c1 FROM t1 FULL OUTER JOIN t2 USING(c1)",
|
||||
"SELECT c1 FROM t1 FULL JOIN t2 USING(c1)",
|
||||
);
|
||||
|
||||
let res = parse_sql_statements("SELECT * FROM a OUTER JOIN b ON 1");
|
||||
assert_eq!(
|
||||
ParserError::ParserError("Expected LEFT, RIGHT, or FULL, found: OUTER".to_string()),
|
||||
res.unwrap_err()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue