Page MenuHomePhabricator

D5994.diff
No OneTemporary

D5994.diff

diff --git a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
--- a/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
+++ b/native/cpp/CommonCpp/DatabaseManagers/SQLiteQueryExecutor.cpp
@@ -694,7 +694,12 @@
Logger::log(version_msg.str());
if (db_version == 0) {
- set_up_database(db);
+ auto db_created = set_up_database(db);
+ if (!db_created) {
+ sqlite3_close(db);
+ Logger::log("Database structure creation error.");
+ throw std::runtime_error("Database structure creation error");
+ }
Logger::log("Database structure created.");
sqlite3_close(db);
@@ -720,7 +725,8 @@
if (migrationResult == MigrationResult::FAILURE) {
migration_msg << "migration " << idx << " failed." << std::endl;
Logger::log(migration_msg.str());
- break;
+ sqlite3_close(db);
+ throw std::runtime_error(migration_msg.str());
}
if (migrationResult == MigrationResult::SUCCESS) {
migration_msg << "migration " << idx << " succeeded." << std::endl;

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 5:54 PM (17 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2682144
Default Alt Text
D5994.diff (1 KB)

Event Timeline