LOW: applyMigration deferred rollback skipped when Commit() fails #125
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
merge-ready
merge-ready
needs-checks
needs-checks
needs-rebase
needs-rebase
needs-review
needs-review
needs-rework
needs-rework
notplanned
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#125
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
In
internal/database/migrations.go,applyMigrationhas:When
Commit()fails, the error is stored incommitErr, noterr. The deferred function checkserr, which is nil (from the last successful ExecContext). SoRollback()is never called.Impact
In practice, SQLite automatically rolls back failed commits, so data integrity is maintained. However, this is incorrect Go transaction handling and could cause issues with other database drivers or future changes.
Fix
Assign the commit error back to
err: