Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jazzy] Fix for failing throws_on_invalid_pragma_in_config_file test on Windows (backport #1742) #1746

Merged
merged 1 commit into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ std::shared_ptr<SqliteStatementWrapper> SqliteStatementWrapper::execute_and_rese
std::stringstream errmsg;
errmsg << "Error when processing SQL statement. SQLite error (" <<
return_code << "): " << sqlite3_errstr(return_code);

reset();
throw SqliteException{errmsg.str(), return_code};
}

Expand All @@ -72,7 +72,7 @@ std::shared_ptr<SqliteStatementWrapper> SqliteStatementWrapper::execute_and_rese
std::stringstream errmsg;
errmsg << "Statement returned empty value while result was expected: \'" <<
sqlite3_sql(statement_) << "\'";

reset();
throw SqliteException{errmsg.str(), return_code};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,19 @@ SqliteWrapper::SqliteWrapper(
throw SqliteException{errmsg.str()};
}
}

apply_pragma_settings(pragmas, io_flag);
sqlite3_extended_result_codes(db_ptr, 1);
initialize_application_functions();
try {
apply_pragma_settings(pragmas, io_flag);
sqlite3_extended_result_codes(db_ptr, 1);
initialize_application_functions();
} catch (...) {
const int rc = sqlite3_close(db_ptr);
if (rc != SQLITE_OK) {
ROSBAG2_STORAGE_DEFAULT_PLUGINS_LOG_ERROR_STREAM(
"Could not close open database. Error code: " << rc <<
" Error message: " << sqlite3_errstr(rc));
}
throw;
}
}

SqliteWrapper::SqliteWrapper()
Expand Down
Loading