Skip to content

fix group by ... having ... aliasing once more#2311

Merged
jycor merged 5 commits intomainfrom
james/groupby
Feb 5, 2024
Merged

fix group by ... having ... aliasing once more#2311
jycor merged 5 commits intomainfrom
james/groupby

Conversation

@jycor
Copy link
Contributor

@jycor jycor commented Feb 3, 2024

This PR simplifies the GROUP BY and HAVING aliasing rules to much more closely match MySQL's weirdness.

TODO: Go through various group by aliasing issues and link fixed ones here

correctness: dolthub/dolt#7455

},
Assertions: []ScriptTestAssertion{
{
Query: `SELECT - col2 AS col0 FROM tab2 GROUP BY col0, col2 HAVING NOT + + col2 <= - col0;`,
Copy link
Contributor

Choose a reason for hiding this comment

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

would any subset of these be useful planbuilder tests that verify refs get the right definition id?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added some of these to planbuilder

Copy link
Contributor

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

lgtm, the having scope logic is a lot clearer now. Easier to extend in the future if there are extra edge cases

@jycor jycor merged commit d5876b4 into main Feb 5, 2024
@jycor jycor deleted the james/groupby branch February 5, 2024 19:08
@jycor jycor restored the james/groupby branch February 6, 2024 01:22
@Hydrocharged Hydrocharged deleted the james/groupby branch February 7, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants