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

Wrong results from query with GROUP BY and LIMIT #16262

Closed
systay opened this issue Jun 26, 2024 · 0 comments · Fixed by #16263
Closed

Wrong results from query with GROUP BY and LIMIT #16262

systay opened this issue Jun 26, 2024 · 0 comments · Fixed by #16263

Comments

@systay
Copy link
Collaborator

systay commented Jun 26, 2024

For the query:

select val2, count(*) 
from aggr_test 
group by val2 
order by count(*), val2 
limit 10

We were getting bad results:

Query (select val2, count(*) from aggr_test group by val2 order by count(*), val2 limit 10) results mismatched.
        Vitess Results:
        [INT64(8) INT64(15)]
        [INT64(2) INT64(18)]
        [INT64(4) INT64(18)]
        [INT64(9) INT64(18)]
        [INT64(3) INT64(20)]
        [INT64(5) INT64(20)]
        [INT64(0) INT64(22)]
        [INT64(1) INT64(23)]
        [INT64(6) INT64(24)]
        [INT64(7) INT64(29)]
        Vitess RowsAffected: 0
        MySQL Results:
        [INT64(42) INT64(13)]
        [INT64(14) INT64(14)]
        [INT64(25) INT64(14)]
        [INT64(49) INT64(14)]
        [INT64(8) INT64(15)]
        [INT64(23) INT64(15)]
        [INT64(26) INT64(15)]
        [INT64(46) INT64(15)]
        [INT64(10) INT64(16)]
        [INT64(35) INT64(17)]
        MySQL RowsAffected: 0
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 a pull request may close this issue.

1 participant