mirror of
https://github.com/sqlalchemy/sqlalchemy.git
synced 2026-05-29 12:06:28 -04:00
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
(cherry picked from commit 5c60aaefd3)
This commit is contained in:
@@ -1573,6 +1573,12 @@ class NegationTest(fixtures.TestBase, testing.AssertsCompiledSQL):
|
||||
"SELECT mytable.myid, mytable.name FROM "
|
||||
"mytable WHERE mytable.myid != :myid_1 AND NOT mytable.name")
|
||||
|
||||
def test_negate_operator_type(self):
|
||||
is_(
|
||||
(-self.table1.c.myid).type,
|
||||
self.table1.c.myid.type,
|
||||
)
|
||||
|
||||
|
||||
class LikeTest(fixtures.TestBase, testing.AssertsCompiledSQL):
|
||||
__dialect__ = 'default'
|
||||
|
||||
Reference in New Issue
Block a user