util/Database: fail gracefully if db selection didn't work

Change-Id: If4195353859ef4fb845eda5c5ee251a6adf9c5f5
This commit is contained in:
Horst Schirmeier
2013-03-23 18:00:31 +01:00
parent 14b7d4e6f4
commit 95402cee5d
4 changed files with 32 additions and 14 deletions

View File

@ -7,11 +7,15 @@ using namespace fail;
extern Logger log;
void Importer::init(const std::string &variant, const std::string &benchmark, Database *db) {
bool Importer::init(const std::string &variant, const std::string &benchmark, Database *db) {
this->db = db;
m_variant_id = db->get_variant_id(variant, benchmark);
if (!m_variant_id) {
return false;
}
log << "Importing to variant " << variant << "/" << benchmark
<< " (ID: " << m_variant_id << ")" << std::endl;
return true;
}
bool Importer::clear_database() {