]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 10 Sep 2008 21:09:04 +0000 (21:09 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 10 Sep 2008 21:09:04 +0000 (21:09 +0000)
the parenthesis, which seem to get in the way when using in
conjunction with executemany().

CHANGES
lib/sqlalchemy/databases/mysql.py
test/dialect/mysql.py

diff --git a/CHANGES b/CHANGES
index 89b7355237420bc55454df7d4e8457ab8b8b6677..1d98d811cb1f8e14eddb0e8fe819d8c3ccd31ecc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -178,6 +178,10 @@ CHANGES
       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,
index 729e1ad457c0a9959891b23ea7950d2eaf7c07f9..9058df926b1f66899def8feee48aee0a695cec38 100644 (file)
@@ -1948,7 +1948,8 @@ class MySQLCompiler(compiler.DefaultCompiler):
     })
     functions = compiler.DefaultCompiler.functions.copy()
     functions.update ({
-        sql_functions.random: 'rand%(expr)s'
+        sql_functions.random: 'rand%(expr)s',
+        "utc_timestamp":"UTC_TIMESTAMP"
         })
 
 
index 5a03ffa9832a41afbcc777b9f7f0b0c5bf8c8595..641139167828f029bc28cefc16b3296c02ad42d7 100644 (file)
@@ -864,6 +864,9 @@ class SQLTest(TestBase, AssertsCompiledSQL):
             "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