diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-07-01 12:44:47 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2016-07-01 12:44:47 -0400 |
| commit | 5c60aaefd32a7bdee611fb340911409e0b8223ed (patch) | |
| tree | b5d13754a0c420db26eaf343a71d4d2ef946de61 /test/sql/test_operators.py | |
| parent | 0e4469150acae9374aec5dff66ca996683c7c744 (diff) | |
| download | sqlalchemy-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 'test/sql/test_operators.py')
| -rw-r--r-- | test/sql/test_operators.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sql/test_operators.py b/test/sql/test_operators.py index 5712d8f99..b6e80de4b 100644 --- a/test/sql/test_operators.py +++ b/test/sql/test_operators.py @@ -1999,6 +1999,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' |
