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

Window function ORDER BY should be optional when frame specification doesn't require it #4141

Closed
knutwannheden opened this issue Aug 18, 2022 · 3 comments · Fixed by dolthub/go-mysql-server#1203
Labels
bug Something isn't working

Comments

@knutwannheden
Copy link

According to the documentation:

RANGE on a numeric or temporal expr requires ORDER BY on a numeric or temporal expression, respectively.

Thus it should be allowed to write a window function like:

sum(b) over (partition by a range between unbounded preceding and unbounded following)

MySQL also accepts this, but Dolt raises an error: [HY000][1105] a range's order by must be one expression; found: 0.

@knutwannheden knutwannheden changed the title Window function order by should be optional when frame specification doesn't require it Window function ORDER BY should be optional when frame specification doesn't require it Aug 18, 2022
@fulghum fulghum added the bug Something isn't working label Aug 18, 2022
@fulghum
Copy link
Contributor

fulghum commented Aug 18, 2022

Thanks for reporting this one Knut. You're right that Dolt isn't matching MySQL's behavior here. We'll dig in.

@fulghum
Copy link
Contributor

fulghum commented Aug 19, 2022

Hey @knutwannheden, I got the fix for this one merged into go-mysql-server and I'll get Dolt updated with this latest version this afternoon. I'll ping again when this goes out in a Dolt release, likely early next week.

@fulghum
Copy link
Contributor

fulghum commented Aug 23, 2022

Just closing the loop here... Dolt 0.40.28 was just released, and contains this fix.

Thanks for reporting this one so we could get it fixed! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants