From 7c05430d28713f28e0376abefaa31071515c8750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 21 Sep 2026 21:22:38 +0200 Subject: [PATCH 1/3] Stop tracking Savepoint rollback state --- src/Savepoint.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Savepoint.cpp b/src/Savepoint.cpp index b0fa9e76..1b87ee86 100644 --- a/src/Savepoint.cpp +++ b/src/Savepoint.cpp @@ -40,10 +40,7 @@ Savepoint::~Savepoint() { try { - if (!mbRolledBack) - { - rollbackTo(); - } + rollbackTo(); release(); } catch (...) @@ -74,7 +71,6 @@ void Savepoint::rollbackTo() if (!mbReleased) { mDatabase.exec(std::string("ROLLBACK TO SAVEPOINT ") + msName); - mbRolledBack = true; } else { From 221b5a1a629f0db8ca3e02300c7c432ec693cbdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 21 Sep 2026 21:22:41 +0200 Subject: [PATCH 2/3] Restore Savepoint 3.x ABI layout --- include/SQLiteCpp/Savepoint.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/SQLiteCpp/Savepoint.h b/include/SQLiteCpp/Savepoint.h index f0b67701..180f8ac4 100644 --- a/include/SQLiteCpp/Savepoint.h +++ b/include/SQLiteCpp/Savepoint.h @@ -90,10 +90,9 @@ class SQLITECPP_API Savepoint void rollback() { rollbackTo(); } private: - Database& mDatabase; ///< Reference to the SQLite Database Connection - std::string msName; ///< Name of the Savepoint - bool mbReleased = false; ///< True when release has been called - bool mbRolledBack = false; ///< True when a rollback to the savepoint has been done + Database& mDatabase; ///< Reference to the SQLite Database Connection + std::string msName; ///< Name of the Savepoint + bool mbReleased = false; ///< True when release has been called }; } // namespace SQLite From f52577165afb5537ddc9bb7ddffcc012c8fb667a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 21 Sep 2026 21:23:00 +0200 Subject: [PATCH 3/3] Update CHANGELOG for Savepoint ABI fix --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a03ffadf..1a3ddae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -310,7 +310,8 @@ Version 3.4.0 - 2026 ??? - Restore the Coverity Scan static analysis as a GitHub Actions workflow, replacing the old Travis CI job - Fix Database::getHeaderInfo() signed-shift UB and use fixed-width types for the Header struct (#558) - Restore SQLite::Header 3.x ABI compatibility while keeping fixed-width header parsing (#575) -- Fix Savepoint destructor to catch all exceptions and track rollback state to avoid std::terminate (#559) +- Fix Savepoint destructor to catch all exceptions to avoid std::terminate (#559) +- Restore SQLite::Savepoint 3.x ABI compatibility while retaining destructor exception safety (#576) - Fix Transaction destructor to catch all exceptions to avoid std::terminate (#559) - Fix the Meson build when the SQLITECPP_DISABLE_STD_FILESYSTEM option is enabled (#560) - Add Statement::RowIterator to support range-based for loops over query results (#181)