Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL)
Description
Please fix "Fix Version/s" as needed, if needed, I'm not sure in which versions it can and should be fixed. MySQL apparently fixed it in 5.6+, but whether it was before or after 5.6 became GA, I can't say.
set sql_mode=only_full_group_by; |
|
create table t (a int, b int, c int); |
insert into t values (1,2,3),(4,5,6); |
select a, min(b) from t group by a order by c, a; |
|
drop table t; |
10.7 f5ecaf23 |
set sql_mode=only_full_group_by; |
create table t (a int, b int, c int); |
insert into t values (1,2,3),(4,5,6); |
select a, min(b) from t group by a order by c, a; |
a min(b) |
1 2
|
4 5
|
Active versions of MySQL prohibit it:
MySQL 5.6.51 |
set sql_mode=only_full_group_by; |
create table t (a int, b int, c int); |
insert into t values (1,2,3),(4,5,6); |
bug.t [ fail ]
|
Test ended at 2021-12-19 20:40:36 |
|
CURRENT_TEST: bug.t
|
mysqltest: At line 5: query 'select a, min(b) from t group by a order by c, a' failed: 1055: 'test.t.c' isn't in GROUP BY |
So does PostgreSQL:
psql (12.9 (Ubuntu 12.9-0ubuntu0.20.04.1))
|
Type "help" for help. |
|
postgres=# drop table t; |
ERROR: table "t" does not exist |
postgres=# create table t (a int, b int, c int); |
CREATE TABLE |
postgres=# insert into t values (1,2,3),(4,5,6); |
INSERT 0 2 |
postgres=# select a, min(b) from t group by a order by c, a; |
ERROR: column "t.c" must appear in the GROUP BY clause or be used in an aggregate function |
LINE 1: select a, min(b) from t group by a order by c, a; |
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Fix Version/s | 10.2 [ 14601 ] |
Fix Version/s | 10.7 [ 24805 ] |
Fix Version/s | 10.3 [ 22126 ] |
Fix Version/s | 10.4 [ 22408 ] |