summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/sqlalchemy/orm/properties.py2
-rw-r--r--lib/sqlalchemy/sql/expression.py2
-rw-r--r--test/dialect/test_postgresql.py2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py
index 56a03fc7c..e900b0cab 100644
--- a/lib/sqlalchemy/orm/properties.py
+++ b/lib/sqlalchemy/orm/properties.py
@@ -134,7 +134,7 @@ class ColumnProperty(StrategizedProperty):
def reverse_operate(self, op, other, **kwargs):
col = self.__clause_element__()
- return op(col._bind_param(other), col, **kwargs)
+ return op(col._bind_param(op, other), col, **kwargs)
# TODO: legacy..do we need this ? (0.5)
ColumnComparator = Comparator
diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py
index e4a610e5d..c559f3850 100644
--- a/lib/sqlalchemy/sql/expression.py
+++ b/lib/sqlalchemy/sql/expression.py
@@ -2167,7 +2167,7 @@ class _BindParamClause(ColumnElement):
if _compared_to_type is not None:
self.type = _compared_to_type._coerce_compared_value(_compared_to_operator, value)
else:
- self.type = sqltypes.NULLTYPE
+ self.type = sqltypes.type_map.get(type(value), sqltypes.NULLTYPE)
elif isinstance(type_, type):
self.type = type_()
else:
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py
index b002e7f19..8358825c4 100644
--- a/test/dialect/test_postgresql.py
+++ b/test/dialect/test_postgresql.py
@@ -106,7 +106,7 @@ class CompileTest(TestBase, AssertsCompiledSQL):
self.assert_compile(schema.CreateIndex(idx),
"CREATE INDEX test_idx1 ON testtbl (data) WHERE data > 5 AND data < 10", dialect=postgresql.dialect())
-
+
def test_extract(self):
t = table('t', column('col1', DateTime), column('col2', Date), column('col3', Time),
column('col4', postgresql.INTERVAL)