after from_statement() were called.
[ticket:2199]. Also in 0.6.9.
+- sql
+ - Fixed a subtle bug involving column
+ correspondence in a selectable with the
+ same column repeated. Affects [ticket:2188].
+
- engine
- Use urllib.parse_qsl() in Python 2.6 and above,
no deprecation warning about cgi.parse_qsl()
'use_labels for select() statements.' % (key,
getattr(existing, 'table', None)))
self._all_cols.remove(existing)
+ # pop out memoized proxy_set as this
+ # operation may very well be occurring
+ # in a _make_proxy operation
+ value.__dict__.pop('proxy_set', None)
self._all_cols.add(value)
self._data[key] = value
"""
# dont dig around if the column is locally present
-
if self.c.contains_column(column):
return column
col, intersect = None, None
is_literal=is_literal
)
c.proxies = [self]
+
if attach:
selectable._columns[c.name] = c
return c
assert s.corresponding_column(s.c.col1) is s.c.col1
assert s.corresponding_column(s.c.c1) is s.c.c1
+ def test_labeled_subquery_twice(self):
+ scalar_select = select([table1.c.col1]).label('foo')
+
+ s1 = select([scalar_select])
+ s2 = select([scalar_select, scalar_select])
+
+ eq_(
+ s1.c.foo.proxy_set,
+ set([s1.c.foo, scalar_select, scalar_select.element, table1.c.col1])
+ )
+ eq_(
+ s2.c.foo.proxy_set,
+ set([s2.c.foo, scalar_select, scalar_select.element, table1.c.col1])
+ )
+
+ assert s1.corresponding_column(scalar_select) is s1.c.foo
+ assert s2.corresponding_column(scalar_select) is s2.c.foo
+
def test_direct_correspondence_on_labels(self):
# this test depends on labels being part
# of the proxy set to get the right result