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 for grouping by integer functions #8866

Merged

Conversation

systay
Copy link
Collaborator

@systay systay commented Sep 22, 2021

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 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 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

Related Issue(s)

Fixes #8855
This is a backport of #8856

Checklist

  • Tests were added or are not required
  • Documentation was added or is not required

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 does not support the generated query -

```sql
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 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
```

Co-authored-by: Manan Gupta <[email protected]>

Signed-off-by: Andres Taylor <[email protected]>
@GuptaManan100 GuptaManan100 merged commit 584f92d into vitessio:release-11.0 Sep 23, 2021
@GuptaManan100 GuptaManan100 deleted the backport-of-8856-to-11 branch September 23, 2021 11:03
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.

2 participants