diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-11-27 05:32:13 +0000 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2005-11-27 05:32:13 +0000 |
commit | 2452cebc23c527ec9361468bb698e279e739d71d (patch) | |
tree | aed1b9b7da3063cf3e6b292cd2d8b7cc2f9793ac /lib/sqlalchemy/databases/mysql.py | |
parent | cdcd74cb390507fc4e04bd61f77a2a2d2baa9614 (diff) | |
download | sqlalchemy-2452cebc23c527ec9361468bb698e279e739d71d.tar.gz |
rowcount doesnt work on MySQL, so disabled concurrency check with mysql
Diffstat (limited to 'lib/sqlalchemy/databases/mysql.py')
-rw-r--r-- | lib/sqlalchemy/databases/mysql.py | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index bf1b19575..e7f64c9b4 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -108,8 +108,15 @@ class MySQLEngine(ansisql.ANSISQLEngine): def rowid_column_name(self): """returns the ROWID column name for this engine.""" + + # well, for MySQL cant really count on this being there, surprise (not). + # so we do some silly hack down below in MySQLTableImpl to provide + # something for an OID column return "_rowid" + def supports_sane_rowcount(self): + return False + def tableimpl(self, table): """returns a new sql.TableImpl object to correspond to the given Table object.""" return MySQLTableImpl(table) @@ -132,15 +139,16 @@ class MySQLEngine(ansisql.ANSISQLEngine): if compiled is None: return if getattr(compiled, "isinsert", False): self.context.last_inserted_ids = [cursor.lastrowid] - - def _executemany(self, c, statement, parameters): - """we need accurate rowcounts for updates, inserts and deletes. mysql is *also* is not nice enough - to produce this correctly for an executemany, so we do our own executemany here.""" - rowcount = 0 - for param in parameters: - c.execute(statement, param) - rowcount += c.rowcount - self.context.rowcount = rowcount + + # executemany just runs normally, since we arent using rowcount at all with mysql +# def _executemany(self, c, statement, parameters): + # """we need accurate rowcounts for updates, inserts and deletes. mysql is *also* is not nice enough + # to produce this correctly for an executemany, so we do our own executemany here.""" + # rowcount = 0 + # for param in parameters: + # c.execute(statement, param) + # rowcount += c.rowcount + # self.context.rowcount = rowcount def dbapi(self): return self.module @@ -152,11 +160,6 @@ class MySQLTableImpl(sql.TableImpl): """attached to a schema.Table to provide it with a Selectable interface as well as other functions """ - -# def __init__(self, table): - # self.table = table - # self.id = self.table.name - def _rowid_col(self): if getattr(self, '_mysql_rowid_column', None) is None: if len(self.table.primary_keys) > 0: |