From da1666cc18cebc485563332d2f1c3d3818affc1f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 1 Mar 2010 01:00:12 +0000 Subject: - adjusted the literal coercion rules to take the left side's type into account, if it is compatible with what was found for the right, so that things like oracle CHAR conversions work. - oracle dialect specific tests pass again. --- lib/sqlalchemy/sql/expression.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index f3a1562c5..1c3961f1f 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -2155,6 +2155,8 @@ class _BindParamClause(ColumnElement): if type_ is None: self.type = sqltypes.type_map.get(type(value), _fallback_type or sqltypes.NULLTYPE) + if _fallback_type and _fallback_type._type_affinity == self.type._type_affinity: + self.type = _fallback_type elif isinstance(type_, type): self.type = type_() else: -- cgit v1.2.1