Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.5, 10.6, 10.11, 11.4
Description
When a column is not a part of GROUP BY expression / an argument of aggregate function and ONLY_FULL_GROUP_BY server SQL mode is enabled then the error 1055 must be generated.
But when such non-aggregated column is an argument of the window function then ONLY_FULL_GROUP_BY server SQL mode is ignored and the query is executed w/o an error.
Sample data:
CREATE TABLE test (id INT, x INT); |
INSERT INTO test VALUES (1,1), (1,2), (2,3), (2,4); |
Query:
SELECT id, SUM(x) sum_x, SUM(x) OVER (PARTITION BY id) wsum_x |
FROM test |
GROUP BY id; |
The error "Error 1055: Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'fiddle.test.x' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by" or similar must be reproted - but the query is executed successfully.
Tested at MariaDB 10.3 and newer.