From 7bf90e2f4dc211423a409a747a2392922ed7a9c7 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 7 Dec 2007 16:47:00 +0000 Subject: fix to unique bind params, you *can* use the same unique bindparam multiple times in a statement. the collision check is strictly detecting non-unique's that happen to have the same name. --- lib/sqlalchemy/sql/compiler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index aec75e76c..6795c2fcd 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -376,7 +376,7 @@ class DefaultCompiler(engine.Compiled): name = self._truncate_bindparam(bindparam) if name in self.binds: existing = self.binds[name] - if existing.unique or bindparam.unique: + if existing is not bindparam and (existing.unique or bindparam.unique): raise exceptions.CompileError("Bind parameter '%s' conflicts with unique bind parameter of the same name" % bindparam.key) self.binds[bindparam.key] = self.binds[name] = bindparam return self.bindparam_string(name) -- cgit v1.2.1