From: Michael Trier Date: Fri, 2 Jan 2009 18:25:04 +0000 (+0000) Subject: Mapped char_length to the LEN() function for mssql. X-Git-Tag: rel_0_5_0~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de97a18bb7eac9f697130e965561240589c590ae;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Mapped char_length to the LEN() function for mssql. --- diff --git a/CHANGES b/CHANGES index 1167519026..cdfe4617a0 100644 --- a/CHANGES +++ b/CHANGES @@ -272,6 +272,8 @@ CHANGES new doc section "Custom Comparators". - mssql + - Mapped ``char_length`` to the ``LEN()`` function. + - If an ``INSERT`` includes a subselect the ``INSERT`` is converted from an ``INSERT INTO VALUES`` construct to a ``INSERT INTO SELECT`` construct. diff --git a/lib/sqlalchemy/databases/mssql.py b/lib/sqlalchemy/databases/mssql.py index 5ad2a93069..963b0e5fec 100644 --- a/lib/sqlalchemy/databases/mssql.py +++ b/lib/sqlalchemy/databases/mssql.py @@ -1377,7 +1377,8 @@ class MSSQLCompiler(compiler.DefaultCompiler): { sql_functions.now: 'CURRENT_TIMESTAMP', sql_functions.current_date: 'GETDATE()', - 'length': lambda x: "LEN(%s)" % x + 'length': lambda x: "LEN(%s)" % x, + sql_functions.char_length: lambda x: "LEN(%s)" % x } )