diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-02 18:11:11 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-04-02 18:11:11 -0400 |
commit | b23bb79581ffab33231bc6fb7a49917888d4a836 (patch) | |
tree | 3893a52a83dab27b719ef7cb93f511721457161d /lib/sqlalchemy/sql/selectable.py | |
parent | 66f2e1257a98bdb257e15a0d9b9588289ef40631 (diff) | |
download | sqlalchemy-b23bb79581ffab33231bc6fb7a49917888d4a836.tar.gz |
- reverse order of columns in sample CTEs as this is a UNION and the cols need to line up
- alter this in the unit tests as well as these queries were just copied from the tests
- remove the included_parts.join(parts) from the core CTE doc (also just copied from the
test, where we want to make sure joins don't get screwed up with the CTE) as it doesn't
contribute to the query itself
fixes #3014
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
-rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index cfa229f94..2aa2c0f40 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -1467,8 +1467,8 @@ class SelectBase(Executable, FromClause): parts_alias = parts.alias() included_parts = included_parts.union_all( select([ - parts_alias.c.part, parts_alias.c.sub_part, + parts_alias.c.part, parts_alias.c.quantity ]). where(parts_alias.c.part==incl_alias.c.sub_part) @@ -1479,8 +1479,6 @@ class SelectBase(Executable, FromClause): func.sum(included_parts.c.quantity). label('total_quantity') ]).\ - select_from(included_parts.join(parts, - included_parts.c.part==parts.c.part)).\\ group_by(included_parts.c.sub_part) result = conn.execute(statement).fetchall() |