summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES4
-rw-r--r--lib/sqlalchemy/databases/mysql.py3
-rw-r--r--test/dialect/mysql.py3
3 files changed, 9 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index 89b735523..1d98d811c 100644
--- 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,
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py
index 729e1ad45..9058df926 100644
--- a/lib/sqlalchemy/databases/mysql.py
+++ b/lib/sqlalchemy/databases/mysql.py
@@ -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"
})
diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py
index 5a03ffa98..641139167 100644
--- a/test/dialect/mysql.py
+++ b/test/dialect/mysql.py
@@ -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