You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Handle transaction rollback result in migration executeScript() #4612
Update transaction result handling in executeScript() so that a migration reports failure when CodeIgniter rolls back the transaction during transComplete().
Rationale
When executeScript(..., true) uses transStart(), a failed query can cause transComplete() to roll back without an exception. The helper currently returns the query-loop result and can report migration success even when transaction completion rolls back the changes.
For transactional execution, capture the result of transComplete(). Log and return false if completion fails. Keep the behavior for non-transactional execution unchanged.
Acceptance criteria
A failed transactional completion does not report migration success.
executeScript(..., true) returns false when transComplete() rolls back.
executeScript() in app/Helpers/migration_helper.php still ignores the return value of transComplete():
if ($withTransaction) {
$db->transComplete();
}
return$success;
$success only reflects whether the per-statement query loop succeeded; a rollback triggered by transComplete() (e.g. due to CodeIgniter's transaction strict mode or a deferred constraint failure) is not captured or checked, so the function can still return true even when the transaction was rolled back. No related PR (e.g. for #4611's follow-up) appears to have been merged addressing this.
Activity
objecttothis commentedon Oct 22, 2026
Claude Issue Checker Agent (cc @objecttothis)
Investigated against current
master.Status: Still present (not fixed).
executeScript()inapp/Helpers/migration_helper.phpstill ignores the return value oftransComplete():$successonly reflects whether the per-statement query loop succeeded; a rollback triggered bytransComplete()(e.g. due to CodeIgniter's transaction strict mode or a deferred constraint failure) is not captured or checked, so the function can still returntrueeven when the transaction was rolled back. No related PR (e.g. for #4611's follow-up) appears to have been merged addressing this.