Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15994,6 +15994,7 @@ impl<'a> Parser<'a> {
if !self
.dialect
.supports_left_associative_joins_without_parens()
&& !natural
&& self.peek_parens_less_nested_join()
{
let joins = self.parse_joins()?;
Expand Down
12 changes: 1 addition & 11 deletions tests/sqlparser_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17439,8 +17439,7 @@ fn column_check_enforced() {

#[test]
fn join_precedence() {
all_dialects_except(|d| !d.supports_left_associative_joins_without_parens())
.verified_query_with_canonical(
all_dialects().verified_query_with_canonical(
"SELECT *
FROM t1
NATURAL JOIN t5
Expand All @@ -17449,15 +17448,6 @@ fn join_precedence() {
// canonical string without parentheses
"SELECT * FROM t1 NATURAL JOIN t5 INNER JOIN t0 ON (t0.v1 + t5.v0) > 0 WHERE t0.v1 = t1.v0",
);
all_dialects_except(|d| d.supports_left_associative_joins_without_parens()).verified_query_with_canonical(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we seem to be removing test coverage for the feature supports_left_associative_joins_without_parens - I think we might want to replace the removal with something else? otherwise its not clear to me if/why we need to keep the dialect flag around

Copy link
Copy Markdown
Author

@revitalkr revitalkr May 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used for queries with join which is not natural join, there's a snowflake dialect test for it, also I added a test for it in my next PR in the common file which is using this feature

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'm expecting us to have a test somewhere in the codebase that uses all_dialects_except(|d| d.supports_left_associative_joins_without_parens())? Otherwise it looks like we're not testing that feature?

"SELECT *
FROM t1
NATURAL JOIN t5
INNER JOIN t0 ON (t0.v1 + t5.v0) > 0
WHERE t0.v1 = t1.v0",
// canonical string with parentheses
"SELECT * FROM t1 NATURAL JOIN (t5 INNER JOIN t0 ON (t0.v1 + t5.v0) > 0) WHERE t0.v1 = t1.v0",
);
}

#[test]
Expand Down