lnd/graph/db/migration1
ziggie 932fbc33f0
graph/db/migration1: fix defer commit/rollback in test tx executor
The defer closure checked a local err variable for commit/rollback
decisions, but err remained nil after a successful BeginTx. When
txBody failed, the error was returned directly without assigning to
err, so the defer always committed instead of rolling back.

Additionally, since err was not a named return value, the defer's
Commit error assignment was silently swallowed.

Replace the error-prone defer pattern with explicit rollback on
txBody failure and a direct Commit return.
2026-02-25 18:52:34 +01:00
..
models multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
sqlc graph/db: freeze sql migration queries 2025-11-12 22:54:06 +08:00
addr.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
codec.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
errors.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
interfaces.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
kv_store.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
log.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
sql_migration.go graph/db: freeze sql migration queries 2025-11-12 22:54:06 +08:00
sql_migration_test.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
sql_store.go graph/db: freeze sql migration queries 2025-11-12 22:54:06 +08:00
test_kvdb.go multi: freeze graph SQL migration logic 2025-11-12 22:54:05 +08:00
test_postgres.go graph/db: freeze sql migration queries 2025-11-12 22:54:06 +08:00
test_sql.go graph/db/migration1: fix defer commit/rollback in test tx executor 2026-02-25 18:52:34 +01:00
test_sqlite.go graph/db: freeze sql migration queries 2025-11-12 22:54:06 +08:00