From c01558ae7f4af08acc523786e107ea5e2e214184 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 28 Mar 2014 16:32:11 -0400 Subject: - Fixed ORM bug where changing the primary key of an object, then marking it for DELETE would fail to target the correct row for DELETE. Then to compound matters, basic "number of rows matched" checks were not being performed. Both issues are fixed, however note that the "rows matched" check requires so-called "sane multi-row count" functionality; the DBAPI's executemany() method must count up the rows matched by individual statements and SQLAlchemy's dialect must mark this feature as supported, currently applies to some mysql dialects, psycopg2, sqlite only. fixes #3006 - Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as this seems to be supported as of psycopg2 2.0.9. --- lib/sqlalchemy/testing/exclusions.py | 3 +++ lib/sqlalchemy/testing/requirements.py | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'lib/sqlalchemy/testing') diff --git a/lib/sqlalchemy/testing/exclusions.py b/lib/sqlalchemy/testing/exclusions.py index 00bb69cbc..00ca28428 100644 --- a/lib/sqlalchemy/testing/exclusions.py +++ b/lib/sqlalchemy/testing/exclusions.py @@ -74,6 +74,9 @@ class skip_if(object): self._fails_on = skip_if(other, reason) return self + def fails_on_everything_except(self, *dbs): + self._fails_on = skip_if(fails_on_everything_except(*dbs)) + return self class fails_if(skip_if): def __call__(self, fn): diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 76e48f8c8..07b5697e2 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -47,6 +47,12 @@ class SuiteRequirements(Requirements): return exclusions.open() + @property + def non_updating_cascade(self): + """target database must *not* support ON UPDATE..CASCADE behavior in + foreign keys.""" + return exclusions.closed() + @property def deferrable_fks(self): return exclusions.closed() -- cgit v1.2.1