Grouping by entity does not work for some dialects

Description

Server which does not support columns in the select list if not contained in the "group by" clause, fail when grouping by entity.

For example, this fails on SQL Server 2012 (but succeed in H2):

The generated query is:

which fails with this error:

Column 'dbo.Bar.id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.

In H2 the same query doesn't fail, because it supports additional columns in the select list if those columns are known to be "dependent" on the grouped ones.

Environment

SQL Server 2012

Assignee

Unassigned

Reporter

Giovanni Lovato

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure