diff options
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 314cb8dac..f2544e9b5 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -158,6 +158,7 @@ from array import array as _array from sqlalchemy import exceptions, logging, schema, sql, util from sqlalchemy.sql import operators as sql_operators +from sqlalchemy.sql import functions as sql_functions from sqlalchemy.sql import compiler from sqlalchemy.engine import base as engine_base, default @@ -1898,6 +1899,11 @@ class MySQLCompiler(compiler.DefaultCompiler): sql_operators.concat_op: lambda x, y: "concat(%s, %s)" % (x, y), sql_operators.mod: '%%' }) + functions = compiler.DefaultCompiler.functions.copy() + functions.update ({ + sql_functions.random: 'rand%(expr)s' + }) + def visit_typeclause(self, typeclause): type_ = typeclause.type.dialect_impl(self.dialect) |