From: Mike Bayer Date: Wed, 10 Sep 2008 21:09:04 +0000 (+0000) Subject: - the function func.utc_timestamp() compiles to UTC_TIMESTAMP, without X-Git-Tag: rel_0_5rc1~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a21dc3d3e382e8e2b0a842c3da81e770cd5d6f67;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - 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(). --- diff --git a/CHANGES b/CHANGES index 89b7355237..1d98d811cb 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 729e1ad457..9058df926b 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 5a03ffa983..6411391678 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