diff options
author | mike bayer <mike_mp@zzzcomputing.com> | 2022-01-20 23:04:24 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2022-01-20 23:04:24 +0000 |
commit | 952f480bfe401ca35ff3ec3d87fa57ad2a87cf37 (patch) | |
tree | def4b777768a37b88cf027e24c2629d7776002e7 /lib/sqlalchemy/sql/compiler.py | |
parent | 297aebf2b686d17ad275d22e2dcacfb5884510ab (diff) | |
parent | 867235e4902c91531095676e3a413d935181b0bd (diff) | |
download | sqlalchemy-952f480bfe401ca35ff3ec3d87fa57ad2a87cf37.tar.gz |
Merge "repair broken truediv test suite; memusage" into main
Diffstat (limited to 'lib/sqlalchemy/sql/compiler.py')
-rw-r--r-- | lib/sqlalchemy/sql/compiler.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index af39f0672..8a3f26425 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1932,7 +1932,13 @@ class SQLCompiler(Compiled): # TODO: would need a fast cast again here, # unless we want to use an implicit cast like "+ 0.0" + self.process( - elements.Cast(binary.right, sqltypes.Numeric()), **kw + elements.Cast( + binary.right, + binary.right.type + if binary.right.type._type_affinity is sqltypes.Numeric + else sqltypes.Numeric(), + ), + **kw, ) ) else: |