]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
don't rely on pk-only group_by
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 Mar 2021 14:37:12 +0000 (10:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 25 Mar 2021 14:37:12 +0000 (10:37 -0400)
Fixed the test test_aliased_stmt_includes_unnamed_fn
recently added in c1c999c01d to include the additional
column in the GROUP BY statement, allowing this statement
to succeed on SQL Server which seems to not support "group by pk only"
syntax.

Change-Id: I42184d77c9017ebdb76ac5a9ae1f8128561243ec

test/orm/test_eager_relations.py

index b42c704310787f1838c9b52d9e269a352837d3d8..4cb6932cbc86ed0dce7efe700f1931cdb53827c4 100644 (file)
@@ -513,7 +513,7 @@ class EagerTest(_fixtures.FixtureTest, testing.AssertsCompiledSQL):
         q = (
             s.query(User, func.count(User.id))
             .order_by(User.id)
-            .group_by(User.id)
+            .group_by(User.id, User.name)
             .limit(1)
         )