Conversation
Steveb-p
force-pushed
the
ibx-12530-fixture-fk-checks
branch
4 times, most recently
from
September 18, 2026 12:39
b913c35 to
caa21b6
Compare
TRUNCATE is DDL. MySQL and MariaDB commit implicitly on it, which ends the transaction the test suite wraps each test in and discards its savepoints - the suite then loses isolation, rows disappear between tests and DAMA's rollback fails with "SAVEPOINT DAMA_TEST does not exist". PostgreSQL refuses it for any table a foreign key references and aborts the whole transaction, so the DELETE written here as a fallback could never actually run: it failed too, with "current transaction is aborted", which is all the caller ever got to see. Detecting the transaction needs the driver connection rather than Connection::isTransactionActive(): dama/doctrine-test-bundle opens its transaction underneath DBAL, so Doctrine's nesting counter reports zero while the session is inside one. Outside a transaction TRUNCATE is still used, so the fast path is unchanged where it is safe.
Steveb-p
force-pushed
the
ibx-12530-fixture-fk-checks
branch
from
September 18, 2026 14:35
caa21b6 to
48cbdd3
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description:
FixtureImportertruncates every table a fixture mentions before re-inserting rows.TRUNCATEisDDL, and inside a transaction both supported databases punish it:
dama/doctrine-test-bundlewraps eachtest in and discarding its savepoints. The suite loses isolation for the rest of the run and
reports
SAVEPOINT DAMA_TEST does not exist, with rows missing between tests.transaction — so the
DELETEwritten here as a fallback could never actually run either. Itfailed too, with
current transaction is aborted, and that is all the caller ever saw.Nothing is gained by
TRUNCATEthere anyway: the rows are a fixture, not a real data set. Outsidea transaction it is still used, so the fast path is unchanged where it is safe.
Detecting the transaction needs the driver connection rather than
Connection::isTransactionActive()— DAMA opens its transaction underneath DBAL, so Doctrine's nesting counter reports zero while the
session is inside one. This was confirmed the hard way: a first attempt using Doctrine's counter was
inert, and
cannot truncate a table referenced in a foreign key constraintkept appearing.For QA:
Verified against
ibexa/dashboard, whose integration suite could not finish bootstrapping on eitherdatabase. With this change all four of its PostgreSQL and MySQL integration jobs pass.