Skip to content

Fixed regression for grouping by integer functions#8865

Merged
GuptaManan100 merged 1 commit intovitessio:release-10.0from
planetscale:backport-of-8856
Sep 23, 2021
Merged

Fixed regression for grouping by integer functions#8865
GuptaManan100 merged 1 commit intovitessio:release-10.0from
planetscale:backport-of-8856

Conversation

@systay
Copy link
Copy Markdown
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

Copy link
Copy Markdown
Contributor

@GuptaManan100 GuptaManan100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! ❤️

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 <manan@planetscale.com>

Signed-off-by: Andres Taylor <andres@planetscale.com>
@GuptaManan100 GuptaManan100 merged commit fcc58a6 into vitessio:release-10.0 Sep 23, 2021
@GuptaManan100 GuptaManan100 deleted the backport-of-8856 branch September 23, 2021 09:48
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