-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
IN
predicate returns wrong results when used with GROUP BY ... HAVING
subquery
#4365
IN
predicate returns wrong results when used with GROUP BY ... HAVING
subquery
#4365
Comments
Thanks for the bug report Knut. I was able to reproduce this with dolt version 0.41.4. We'll debug through this one and see what's going on. |
Great work on this fix @jennifersp! @knutwannheden – thanks again for helping us find all these great issues to fix! 🙏 Very appreciated! This fix will go out with the next Dolt release. Let us know if you find anything else odd for us to dig into. |
AFAICT the PR was reverted again. Should this issue be reopened again? |
Hi @knutwannheden, ah yes I'll re-open it for now. It needs fix for the tests only. I'll merge it back again with the tests fixed tomorrow. Sorry about that. |
Hey @knutwannheden, the fix has been merged with fixed tests, it will be included in the next Dolt release. Thank you again for helping us find this bug! :) |
The example data looks like this:
The following query is expected to return 2 tuples (
(2, 'b')
and(4, 'd')
) but only returns one of them ((4, 'd')
):When the
HAVING
clause is changed tocount(1) != 1
the query returns the same result, even though it should have returned the other 6 tuples (wherei in (1, 3, 5)
):I checked that this isn't an aliasing issue, so I don't know what is going on here.
I can change the query to use a CTE or a
JOIN
with the subquery and then the result returned is correct.The text was updated successfully, but these errors were encountered: