Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enginetest: Add BrokenQueries tests for projections in group by nodes not handling subquery expressions well. #578

Merged
merged 2 commits into from
Oct 5, 2021
Merged
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
9 changes: 9 additions & 0 deletions enginetest/queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -5656,6 +5656,15 @@ var BrokenQueries = []QueryTest{
Query: "SELECT 1 FROM DUAL WHERE (null, null) = (select null, null from dual)",
Expected: []sql.Row{},
},
// pushdownGroupByAliases breaks queries where subquery expressions
// reference the outer table and an alias gets pushed to a projection
// below a group by node.
{
Query: "SELECT c AS i_do_not_conflict, COUNT(*), MIN((SELECT COUNT(*) FROM (SELECT 1 AS d) b WHERE b.d = a.c)) FROM (SELECT 1 AS c) a GROUP BY i_do_not_conflict;",
},
{
Query: "SELECT c AS c, COUNT(*), MIN((SELECT COUNT(*) FROM (SELECT 1 AS d) b WHERE b.d = a.c)) FROM (SELECT 1 AS c) a GROUP BY a.c;",
},
}

var VersionedQueries = []QueryTest{
Expand Down