]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- mod operator '%' produces MOD [ticket:624]
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 15 Jul 2007 03:59:38 +0000 (03:59 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 15 Jul 2007 03:59:38 +0000 (03:59 +0000)
CHANGES
lib/sqlalchemy/databases/oracle.py

diff --git a/CHANGES b/CHANGES
index 699fb9bcafc2cf84eac13f0166d1c8d09125f150..81945bffec44c4877169f40bfd9538ed3846423a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
       LOB objects detected in a result set to be forced into OracleBinary
       so that the LOB is read() automatically, if no typemap was present
       (i.e., if a textual execute() was issued).
+    - mod operator '%' produces MOD [ticket:624]
 - postgres
     - fixed escaping of the modulo operator [ticket:624]
     - added support for reflection of domains [ticket:570]
index 06a8af0f8a0a08d4acf122127c065b0d74cd23d0..e7f8f483ae1bc6b85e54a614e115b9d59607cb22 100644 (file)
@@ -601,6 +601,13 @@ class OracleCompiler(ansisql.ANSICompiler):
         else:
             return super(OracleCompiler, self).for_update_clause(select)
 
+    def visit_binary(self, binary):
+        if binary.operator == '%': 
+            self.strings[binary] = ("MOD(%s,%s)"%(self.get_str(binary.left), self.get_str(binary.right)))
+        else:
+            return ansisql.ANSICompiler.visit_binary(self, binary)
+        
+
 class OracleSchemaGenerator(ansisql.ANSISchemaGenerator):
     def get_column_specification(self, column, **kwargs):
         colspec = self.preparer.format_column(column)