diff options
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/engine/default.py | 6 | ||||
-rw-r--r-- | lib/sqlalchemy/orm/mapper.py | 15 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py index fecc16b3c..40939d1a8 100644 --- a/lib/sqlalchemy/engine/default.py +++ b/lib/sqlalchemy/engine/default.py @@ -107,7 +107,11 @@ class DefaultDialect(base.Dialect): #self.supports_unicode_statements = True #self.supports_unicode_binds = True #self.returns_unicode_strings = True - + + @property + def dialect_description(self): + return self.name + "+" + self.driver + def initialize(self, connection): try: self.server_version_info = self._get_server_version_info(connection) diff --git a/lib/sqlalchemy/orm/mapper.py b/lib/sqlalchemy/orm/mapper.py index 9b5583afa..881f0d546 100644 --- a/lib/sqlalchemy/orm/mapper.py +++ b/lib/sqlalchemy/orm/mapper.py @@ -1414,7 +1414,7 @@ class Mapper(object): if update: mapper = table_to_mapper[table] clause = sql.and_() - + for col in mapper._pks_by_table[table]: clause.clauses.append(col == sql.bindparam(col._label, type_=col.type)) @@ -1429,9 +1429,16 @@ class Mapper(object): rows += c.rowcount - if c.supports_sane_rowcount() and rows != len(update): - raise exc.ConcurrentModificationError("Updated rowcount %d does not match number of objects updated %d" % (rows, len(update))) - + if connection.dialect.supports_sane_rowcount: + if rows != len(update): + raise exc.ConcurrentModificationError( + "Updated rowcount %d does not match number of objects updated %d" % + (rows, len(update))) + + elif mapper.version_id_col is not None: + util.warn("Dialect %s does not support updated rowcount " + "- versioning cannot be verified." % c.dialect.dialect_description) + if insert: statement = table.insert() for state, params, mapper, connection, value_params in insert: |