summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/databases/mysql.py
diff options
context:
space:
mode:
authorAnts Aasma <ants.aasma@gmail.com>2007-06-26 16:37:30 +0000
committerAnts Aasma <ants.aasma@gmail.com>2007-06-26 16:37:30 +0000
commitb191254d8aceca10b40dd5957f3ddf9147a4c534 (patch)
tree1362d1c2b224c1b3a102f5656236e61be18b320f /lib/sqlalchemy/databases/mysql.py
parent987581e6d2c893f4fe1c6877bd4b096f00ff63c3 (diff)
downloadsqlalchemy-b191254d8aceca10b40dd5957f3ddf9147a4c534.tar.gz
fix #624, modulo operator escaping on mysql and postgres
someone should test this with oracle, firebird and sql server also
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r--lib/sqlalchemy/databases/mysql.py6
1 files changed, 6 insertions, 0 deletions
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):