• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

SRombauts / SQLiteCpp / 28507929241
100%

Build:
DEFAULT BRANCH: master
Ran 01 Jul 2026 09:34AM UTC
Jobs 1
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Jul 2026 09:33AM UTC coverage: 99.689% (+0.001%) from 99.688%
28507929241

push

github

web-flow
Fix Savepoint destructor exception-safety and rollback bookkeeping (#559)

## Summary

Fixes two findings from the deep code review (SP-03, SP-02) in the
`Savepoint` destructor. The documented auto-rollback-on-scope-exit
semantics are unchanged.

### SP-03 — destructor could call `std::terminate`
`~Savepoint()` caught only `SQLite::Exception`. Building the `"ROLLBACK
TO SAVEPOINT " + msName` / `"RELEASE SAVEPOINT " + msName` strings can
throw `std::bad_alloc`, and any non-`SQLite::Exception` thrown during
cleanup would escape the implicitly `noexcept` destructor and terminate
the process. The handler is now `catch (...)`, matching the stated
intent ("Never throw an exception in a destructor").

### SP-02 — no rolled-back state, fragile double-rollback
There was a single `mbReleased` flag and no notion of "already rolled
back", so after a manual `rollbackTo()` (or on the normal scope-exit
path) the destructor issued a `ROLLBACK TO` and then a `RELEASE`,
relying on SQLite tolerating a repeated `ROLLBACK TO`. A new
`mbRolledBack` flag (set in `rollbackTo()`) lets the destructor do the
minimum: skip the redundant `ROLLBACK TO` and just `RELEASE`.

## Test plan
- Added `Savepoint.rollbackToThenRelease` covering a manual
`rollbackTo()` followed by `release()` and a clean scope exit.
- Built `SQLiteCpp_tests` (MSVC, Debug); `ctest -C Debug` 100% passed,
including the existing `Savepoint.commitRollback` and
`Savepoint.destructorSwallowsException` tests.

No public API or behavioural change on the happy path; only the
(previously UB-on-OOM) destructor error handling and the
redundant-command path change.

5 of 5 new or added lines in 2 files covered. (100.0%)

641 of 643 relevant lines covered (99.69%)

34.41 hits per line

Jobs
ID Job ID Ran Files Coverage
1 28507929241.1 01 Jul 2026 09:34AM UTC 14
99.69
GitHub Action Run
Source Files on build 28507929241
  • Tree
  • List 14
  • Changed 3
  • Source Changed 3
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28507929241
  • 4ee4be1f on github
  • Prev Build on master (#28478122417)
  • Next Build on master (#28533978851)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc