after the event was associated
with the Session class. [ticket:2424]
+ - [bug] Fixed bug whereby a primaryjoin
+ condition with a "literal" in it would
+ raise an error on compile with certain
+ kinds of deeply nested expressions
+ which also needed to render the same
+ bound parameter name more than once.
+ [ticket:2425]
+
- [feature] Added "no_autoflush" context
manager to Session, used with with:
will temporarily disable autoflush.
if name in self.binds:
existing = self.binds[name]
if existing is not bindparam:
- if existing.unique or bindparam.unique:
+ if (existing.unique or bindparam.unique) and \
+ not existing.proxy_set.intersection(bindparam.proxy_set):
raise exc.CompileError(
"Bind parameter '%s' conflicts with "
"unique bind parameter of the same name" %
assert b4.left is bin.left # since column is immutable
assert b4.right is not bin.right is not b2.right is not b3.right
+ def test_bind_unique_test(self):
+ t1 = table('t', column('a'), column('b'))
+
+ b = bindparam("bind", value="x", unique=True)
+
+ # the annotation of "b" should render the
+ # same. The "unique" test in compiler should
+ # also pass, [ticket:2425]
+ eq_(str(or_(b, b._annotate({"foo":"bar"}))),
+ ":bind_1 OR :bind_1")