From a8cdead32632045c29260b9bd7c2bcd5f2c8f221 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 4 Feb 2007 03:12:27 +0000 Subject: - more quoting fixes for [ticket:450]...quoting more aggressive (but still skips already-quoted literals) - got mysql to have "format" as default paramstyle even if mysql module not available, allows unit tests to pass in non-mysql system for [ticket:457]. all the dialects should be changed to pass in their usual paramstyle. --- lib/sqlalchemy/databases/mysql.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index d30751fb4..c09d02756 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -17,6 +17,7 @@ try: import MySQLdb.constants.CLIENT as CLIENT_FLAGS except: mysql = None + CLIENT_FLAGS = None def kw_colspec(self, spec): if self.unsigned: @@ -256,7 +257,7 @@ class MySQLDialect(ansisql.ANSIDialect): self.module = mysql else: self.module = module - ansisql.ANSIDialect.__init__(self, **kwargs) + ansisql.ANSIDialect.__init__(self, default_paramstyle='format', **kwargs) def create_connect_args(self, url): opts = url.translate_connect_args(['host', 'db', 'user', 'passwd', 'port']) @@ -274,7 +275,8 @@ class MySQLDialect(ansisql.ANSIDialect): # TODO: what about options like "ssl", "cursorclass" and "conv" ? client_flag = opts.get('client_flag', 0) - client_flag |= CLIENT_FLAGS.FOUND_ROWS + if CLIENT_FLAGS is not None: + client_flag |= CLIENT_FLAGS.FOUND_ROWS opts['client_flag'] = client_flag return [[], opts] -- cgit v1.2.1