Skip to content

test: add fuzzer correlated subquery cases - #27779

Open
mohammadnaqvi04 wants to merge 2 commits into
apache:mainfrom
mohammadnaqvi04:decorrelation-fuzz-cases
Open

mohammadnaqvi04 wants to merge 2 commits into
apache:mainfrom
mohammadnaqvi04:decorrelation-fuzz-cases

Conversation

@mohammadnaqvi04

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #5492.

Rationale for this change

Step 1 of the plan on #5492 is a tests-only PR with the catalog shapes, the issue repros and the cases the fuzzer found, each with its reference answer. #26904 added the first two to subquery_decorrelation.slt. This adds the cases @jayzhan211's fuzzer found, so later PRs for the general rule have them to check against.

What changes are included in this PR?

Adds 11 queries to the end of subquery_decorrelation.slt, taken from a rerun of the fuzzer on main. Each one covers a kind of failing query the file didn't previously cover, such as grouping sets, sorting and limits inside a subquery, and lateral joins with non-equality correlations. Three cases record a bug that has no issue yet, where a subquery fails to plan when a derived table inside it gives a new column the same name as the column its correlated filter reads.

What is the testing strategy for this PR?

This file passes on main, and --complete leaves it unchanged. Every expected answer comes from DuckDB 2.0.1 and matches SQLite, with the LATERAL and grouping sets queries rewritten into SQLite syntax.

Are there any user-facing changes?

No, this only adds tests.

AI Usage

AI was used during development of this PR, primarily to help review the test suite and verify test cases against the DB binaries.

@github-actions github-actions Bot added the sqllogictest SQL Logic Tests (.slt) label Nov 26, 2026
@mohammadnaqvi04
mohammadnaqvi04 marked this pull request as ready for review November 28, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sqllogictest SQL Logic Tests (.slt)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant