diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-07 16:47:00 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-07 16:47:00 +0000 |
commit | 7bf90e2f4dc211423a409a747a2392922ed7a9c7 (patch) | |
tree | 87500a8d9d1d4bca626fc7a8e51f6ffe2a4e5a28 /lib/sqlalchemy/sql/compiler.py | |
parent | 3715e10bf82786920bf8c018a99221f0d1713b3d (diff) | |
download | sqlalchemy-7bf90e2f4dc211423a409a747a2392922ed7a9c7.tar.gz |
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.
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 2 |
1 files changed, 1 insertions, 1 deletions
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) |