You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select ascii(val1) as a, count(*) from aggr_test group by a
but on main the query fails with the following error -
target: ks.-80.primary: vttablet: rpc error: code = InvalidArgument desc = Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'vt_ks.aggr_test.val1' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (errno 1055) (sqlstate 42000) (CallerID: userData1): Sql: "select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc", BindVars: {}
target: ks.80-.primary: vttablet: rpc error: code = InvalidArgument desc = Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'vt_ks.aggr_test.val1' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (errno 1055) (sqlstate 42000) (CallerID: userData1): Sql: "select ascii(val1) as a, count(*), weight_string(ascii(val1)) from aggr_test group by a order by a asc", BindVars: {} (errno 1055) (sqlstate 42000) during query: select ascii(val1) as a, count(*) from aggr_test group by a
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
```
Fixesvitessio#8855
Signed-off-by: Manan Gupta <manan@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Overview of the Issue
The following query works on release 9.0 -
but on main the query fails with the following error -
Schema for the table is -
Reproduction Steps
Add the query as an end to end test and run it.
Binary version
Log Fragments
The text was updated successfully, but these errors were encountered: