summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/default_comparator.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2013-10-21 16:49:46 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2013-10-21 16:49:46 -0400
commit9caa92b96fef0b3e6d9d280407bc6a092a77b584 (patch)
tree04100e4b13f32d9c3604a208146dc08a372a8e73 /lib/sqlalchemy/sql/default_comparator.py
parent56976624169af6d0d329b4834ee9caa7243573dc (diff)
downloadsqlalchemy-9caa92b96fef0b3e6d9d280407bc6a092a77b584.tar.gz
- A :func:`.bindparam` construct with a "null" type (e.g. no type
specified) is now copied when used in a typed expression, and the new copy is assigned the actual type of the compared column. Previously, this logic would occur on the given :func:`.bindparam` in place. Additionally, a similar process now occurs for :func:`.bindparam` constructs passed to :meth:`.ValuesBase.values` for a :class:`.Insert` or :class:`.Update` construct. [ticket:2850]
Diffstat (limited to 'lib/sqlalchemy/sql/default_comparator.py')
-rw-r--r--lib/sqlalchemy/sql/default_comparator.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/sqlalchemy/sql/default_comparator.py b/lib/sqlalchemy/sql/default_comparator.py
index c9125108a..7c803ac4c 100644
--- a/lib/sqlalchemy/sql/default_comparator.py
+++ b/lib/sqlalchemy/sql/default_comparator.py
@@ -261,10 +261,7 @@ class _DefaultColumnComparator(operators.ColumnOperators):
if isinstance(other, (ColumnElement, TextClause)):
if isinstance(other, BindParameter) and \
other.type._isnull:
- # TODO: perhaps we should not mutate the incoming
- # bindparam() here and instead make a copy of it.
- # this might be the only place that we're mutating
- # an incoming construct.
+ other = other._clone()
other.type = expr.type
return other
elif hasattr(other, '__clause_element__'):