Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Another bug revealed by SQLite, the best database engine out there. In popTransaction(), we need to reset the transaction data (->willRollback, ->rollbackLogs) as early as possible, because in case a transaction is opened by the logging callback, it will get rolled back.
This is the case for both SQLite and PostgreSQL because the default InsertQuery implement starts a transaction to improve the performance of multi-inserts.
Comment | File | Size | Author |
---|---|---|---|
#2 | 715094-reset-transaction-status-early.patch | 1.61 KB | Damien Tournoud |
#1 | 715094-reset-transaction-status-early.patch | 1.71 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedRaising to critical, because it breaks important core features in both SQLite and PostgreSQL.
I don't know if it is useful to test that explicitly. A few tests break on SQLite and PostgreSQL because of that, at least.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedBy David on IRC: there is no need to copy the
$this->willRollBack
variable.Comment #3
Crell CreditAttribution: Crell commentedLooks logical to me. Thanks Damien.
Comment #4
webchickCommitted to HEAD. Thanks!
But is it possible to write tests for this?