Skip to content

Fixed regression for grouping by integer functions#8866

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

Fixed regression for grouping by integer functions#8866
GuptaManan100 merged 1 commit intovitessio:release-11.0from
planetscale:backport-of-8856-to-11

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

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