summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/dialects/mssql/base.py1
-rw-r--r--lib/sqlalchemy/testing/suite/test_select.py9
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mssql/base.py b/lib/sqlalchemy/dialects/mssql/base.py
index ea0ed58a4..26b794712 100644
--- a/lib/sqlalchemy/dialects/mssql/base.py
+++ b/lib/sqlalchemy/dialects/mssql/base.py
@@ -1416,6 +1416,7 @@ class MSDialect(default.DefaultDialect):
use_scope_identity = True
max_identifier_length = 128
schema_name = "dbo"
+ supports_simple_order_by_label = False
colspecs = {
sqltypes.DateTime: _MSDateTime,
diff --git a/lib/sqlalchemy/testing/suite/test_select.py b/lib/sqlalchemy/testing/suite/test_select.py
index 68dadd0a9..ecc92b884 100644
--- a/lib/sqlalchemy/testing/suite/test_select.py
+++ b/lib/sqlalchemy/testing/suite/test_select.py
@@ -86,6 +86,15 @@ class OrderByLabelTest(fixtures.TablesTest):
[(7, ), (5, ), (3, )]
)
+ def test_group_by_composed(self):
+ table = self.tables.some_table
+ expr = (table.c.x + table.c.y).label('lx')
+ stmt = select([func.count(1), expr]).group_by(expr).order_by(expr)
+ self._assert_result(
+ stmt,
+ [(1, 3), (1, 5), (1, 7)]
+ )
+
class LimitOffsetTest(fixtures.TablesTest):
__backend__ = True