summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/default_comparator.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2016-07-01 12:44:47 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2016-07-01 12:44:47 -0400
commit5c60aaefd32a7bdee611fb340911409e0b8223ed (patch)
treeb5d13754a0c420db26eaf343a71d4d2ef946de61 /lib/sqlalchemy/sql/default_comparator.py
parent0e4469150acae9374aec5dff66ca996683c7c744 (diff)
downloadsqlalchemy-5c60aaefd32a7bdee611fb340911409e0b8223ed.tar.gz
Preserve type for math negation
Fixed issue in SQL math negation operator where the type of the expression would no longer be the numeric type of the original. This would cause issues where the type determined result set behaviors. Change-Id: If0e339614a3686e251235fc94b6f59310c4630a5 Fixes: #3735
Diffstat (limited to 'lib/sqlalchemy/sql/default_comparator.py')
-rw-r--r--lib/sqlalchemy/sql/default_comparator.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/default_comparator.py b/lib/sqlalchemy/sql/default_comparator.py
index 7630a9821..827492f10 100644
--- a/lib/sqlalchemy/sql/default_comparator.py
+++ b/lib/sqlalchemy/sql/default_comparator.py
@@ -192,7 +192,7 @@ def _inv_impl(expr, op, **kw):
def _neg_impl(expr, op, **kw):
"""See :meth:`.ColumnOperators.__neg__`."""
- return UnaryExpression(expr, operator=operators.neg)
+ return UnaryExpression(expr, operator=operators.neg, type_=expr.type)
def _match_impl(expr, op, other, **kw):