- changed title to column correspondence in UNIONs, self-referential subqueries
column correspondence in UNIONs, self-referential subqueries
Issue #1268
resolved
We expect that column correspondence for a UNION would place higher precedence on the SELECT at the top. But the current proxy_set/corresponding_column implementation has no awareness of "position" in this way. CompoundSelect
should probably try to resolve ambiguities like this when it first creates the proxy sets, but they have to take into account the full lineage of each column in the select.
from sqlalchemy import *
from sqlalchemy.sql import table, column
t1 = table('t',
column('f1', Integer),
column('f2', Integer)
)
u = union(
select([t1.c.f2](t1.c.f1,)),
select([t1.c.f1](t1.c.f2,))
)
assert u.corresponding_column(t1.c.f1) is u.c.f1
assert u.corresponding_column(t1.c.f2) is u.c.f2
Comments (3)
-
reporter -
reporter -
reporter - removed milestone
Removing milestone: 0.5.0 (automated comment)
- Log in to comment
Before I post the fix, let's also add this seemingly unrelated failure: