From b191254d8aceca10b40dd5957f3ddf9147a4c534 Mon Sep 17 00:00:00 2001 From: Ants Aasma Date: Tue, 26 Jun 2007 16:37:30 +0000 Subject: fix #624, modulo operator escaping on mysql and postgres someone should test this with oracle, firebird and sql server also --- lib/sqlalchemy/databases/mysql.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 91d59f1e2..6e4e0a660 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1205,6 +1205,12 @@ class MySQLCompiler(ansisql.ANSICompiler): text += " \n LIMIT 18446744073709551615" text += " OFFSET " + str(select.offset) return text + + def binary_operator_string(self, binary): + if binary.operator == '%': + return '%%' + else: + return ansisql.ANSICompiler.binary_operator_string(self, binary) class MySQLSchemaGenerator(ansisql.ANSISchemaGenerator): def get_column_specification(self, column, override_pk=False, first_pk=False): -- cgit v1.2.1