1. Ben Trofatter
  2. sqlalchemy-2663

Commits

Mike Bayer  committed c55da26

- the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
the parenthesis, which seem to get in the way when using in
conjunction with executemany().

  • Participants
  • Parent commits 479dfcd
  • Branches default

Comments (0)

Files changed (3)

File CHANGES

View file
  • Ignore whitespace
       MSSmallInteger and MSYear has been renamed to 'display_width'.
       
     - Added MSMediumInteger type [ticket:1146].
+    
+    - the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
+      the parenthesis, which seem to get in the way when using in 
+      conjunction with executemany().
 
 - oracle
     - limit/offset no longer uses ROW NUMBER OVER to limit rows,

File lib/sqlalchemy/databases/mysql.py

View file
  • Ignore whitespace
     })
     functions = compiler.DefaultCompiler.functions.copy()
     functions.update ({
-        sql_functions.random: 'rand%(expr)s'
+        sql_functions.random: 'rand%(expr)s',
+        "utc_timestamp":"UTC_TIMESTAMP"
         })
 
 

File test/dialect/mysql.py

View file
  • Ignore whitespace
             "UPDATE t SET col1=%s WHERE t.col2 = %s LIMIT 1"
             )
 
+    def test_utc_timestamp(self):
+        self.assert_compile(func.utc_timestamp(), "UTC_TIMESTAMP")
+        
     def test_cast(self):
         t = sql.table('t', sql.column('col'))
         m = mysql