Shouldn't this go into the `backends/__init__.py`? Currently CursorDebugWrapper calls ``self.db.set_dirty()``, on postgres this check prevents ``dirty`` from being set (which makes sense cause we are in autocommit by default now). On other backends ``set_dirty()`` is executed unconditionally meaning that the connection is marked dirty even for autocommit, this causes ``connection.abort()`` to issue a rollback at the end of the request (although there is technically nothing to rollback!). After moving this into `backends/__init__.py` the rollback is gone for MySQL too. So all in all my direction seems to be valid, but I have no idea what transaction_state is doing, so I can't see if I reached the correct conlusion.