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

fixed regression in v3 for grouping by integer functions #8856

Merged
merged 4 commits into from
Sep 22, 2021

Conversation

GuptaManan100
Copy link
Member

Description

The regression in the linked issue was found to be occurring from adding weight_string function due to order by as introduced in #7678. MySQL however does not support the generated query -

select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc

In order to fix this, we should also add the weight_string function to the group by clause as follows -

select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a, weight_string(ascii(val1)) order by a asc

This PR accomplishes this change

Related Issue(s)

Checklist

  • Should this PR be backported? Yes
  • Tests were added or are not required
  • Documentation was added or is not required

Deployment Notes

Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Manan Gupta <manan@planetscale.com>
@systay systay merged commit 4dd1616 into vitessio:main Sep 22, 2021
@systay systay deleted the v3-fix-group-by branch September 22, 2021 11:42
systay pushed a commit to systay/vitess that referenced this pull request Sep 22, 2021
This is a backport of vitessio#8856

The regression in the linked issue was found to be occurring from adding weight_string function due to order by as introduced in vitessio#7678. MySQL however does not support the generated query -

```
select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc
```

In order to fix this, we should also add the weight_string function to the group by clause as follows -

```
select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a, weight_string(ascii(val1)) order by a asc
```

Fixes vitessio#8855

Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression in an aggregate query from release-9.0
3 participants