summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/util.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-09-08 16:31:11 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2014-09-08 16:31:11 -0400
commit7904ebc62e0a75d1ea31e1a4ae67654c7681a737 (patch)
treea0e162ea74d3bb25390643b7db84bb288ca4e841 /lib/sqlalchemy/sql/util.py
parente4996d4f5432657639798c1b286ee811a36e2a10 (diff)
downloadsqlalchemy-7904ebc62e0a75d1ea31e1a4ae67654c7681a737.tar.gz
- rework the previous "order by" system in terms of the new one,
unify everything. - create a new layer of separation between the "from order bys" and "column order bys", so that an OVER doesn't ORDER BY a label in the same columns clause - identify another issue with polymorphic for ref #3148, match on label keys rather than the objects
Diffstat (limited to 'lib/sqlalchemy/sql/util.py')
-rw-r--r--lib/sqlalchemy/sql/util.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index d6f3b5915..fbbe15da3 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -16,7 +16,7 @@ from itertools import chain
from collections import deque
from .elements import BindParameter, ColumnClause, ColumnElement, \
- Null, UnaryExpression, literal_column, Label
+ Null, UnaryExpression, literal_column, Label, _label_reference
from .selectable import ScalarSelect, Join, FromClause, FromGrouping
from .schema import Column
@@ -161,6 +161,8 @@ def unwrap_order_by(clause):
not isinstance(t, UnaryExpression) or
not operators.is_ordering_modifier(t.modifier)
):
+ if isinstance(t, _label_reference):
+ t = t.element
cols.add(t)
else:
for c in t.get_children():