diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-12-15 01:07:05 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2006-12-15 01:07:05 +0000 |
commit | 422558bc5d58557a758b56f4d592d08dd6f86309 (patch) | |
tree | bbb3436b260ddc9d0c4d2fa3a3c53b046df24264 /lib/sqlalchemy/databases | |
parent | 8a59bbed499395a0ae4a5eb08fdad708e2c43ca5 (diff) | |
download | sqlalchemy-422558bc5d58557a758b56f4d592d08dd6f86309.tar.gz |
fix to the fix for [ticket:396] plus a unit test
Diffstat (limited to 'lib/sqlalchemy/databases')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 19dedd826..a452a696e 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -299,9 +299,11 @@ class MySQLDialect(ansisql.ANSIDialect): def preparer(self): return MySQLIdentifierPreparer(self) - def do_executemany(self, cursor, statement, parameters, **kwargs): + def do_executemany(self, cursor, statement, parameters, context=None, **kwargs): try: - cursor.executemany(statement, parameters) + rowcount = cursor.executemany(statement, parameters) + if context is not None: + context._rowcount = rowcount except mysql.OperationalError, o: if o.args[0] == 2006 or o.args[0] == 2014: cursor.invalidate() @@ -316,7 +318,7 @@ class MySQLDialect(ansisql.ANSIDialect): def do_rollback(self, connection): - # some versions of MySQL just dont support rollback() at all.... + # MySQL without InnoDB doesnt support rollback() try: connection.rollback() except: |