diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-04 03:12:27 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-02-04 03:12:27 +0000 |
commit | a8cdead32632045c29260b9bd7c2bcd5f2c8f221 (patch) | |
tree | f8e8d83d18b1eaa97afa3008d1339623692f93a7 /lib/sqlalchemy/databases/mysql.py | |
parent | 5ce214c7d43a0a0f57785a512272ec2102139fa2 (diff) | |
download | sqlalchemy-a8cdead32632045c29260b9bd7c2bcd5f2c8f221.tar.gz |
- 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.
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 6 |
1 files changed, 4 insertions, 2 deletions
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] |