in MySQL-InnoDB (works in SQLite and Postgres).
Tried versions 0.7.3 and 0.7.5
Python 2.7
I tried manually deleting the rows from the table through MySQL client and
noticed that it's not returning an accurate row count (doesn't
'supports_sane_rowcount') for a table with an adjacency relationship and an
ondelete='CASCADE'.
I'm going to work around this by adding another ondelete='CASCADE' for User->A
--
Fayaz Yusuf Khan
Cloud developer and architect
Dexetra SS, Bangalore, India
fayaz.yusuf.khan_AT_gmail_DOT_com
fayaz_AT_dexetra_DOT_com
+91-9746-830-823
I ran this and indeed InnoDB appears to be broken here. This is a MySQL bug. It would appear it is running the cascade between the two "A" rows and only considering the lead object to be the one deleted. Can't exactly find it at bugs.mysql.com either, so you'd do everyone a favor if you could create a ticket over there.
SQLAlchemy can try to work around this but for now you can just flip supports_sane_rowcount off for the whole dialect:
engine.dialect.supports_sane_rowcount = engine.dialect.supports_sane_multi_rowcount = False
The only solution I can see is another mapper flag that lets you disable the rowcount check for specific classes (see http://www.sqlalchemy.org/trac/ticket/2403) . Unfortunately I don't see a way to make this very obvious to users not aware of the issue.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: GPGTools - http://gpgtools.org
iQEcBAEBAgAGBQJPNon9AAoJEDMCOcHE2v7hVeIH/0HFDYCLUiKH6vuRvEvCapjD
XrCwAlpjbu6dCE82YNn00oSvekh0QfFgDgIFafnZzavtE1dn2ve9HvDBviUmmE+h
gpMuhVayAZxZfOAYu8512hSb9rx/ZHQv+wt/e4Rl3pnbBGLq1Jg8bufd+S0Ytkwx
uIktgEQjfEIRJIfBK0/j+xp8y8lVo/2lFA8or/WdLulgepddgOdzEI6RTkUk45pl
Cuq8VVMc49BQaCcgmc0aFmZ9lrhopKii2/31HRca384sk358Otm+9sbomKNdBZbQ
QRh+LhqUL53Rgi+69d2vWPfGZMkvE6q4DI89qVdVlzuh1SXI62vwXTRb/rEuEe4=
=Q+h5
-----END PGP SIGNATURE-----