dbcampaign: skip existing pilots with wrong fspmethod

Loading existing pilots with a different fspmethod_id is a waste of
time.

Change-Id: I3519a14822029999fa2ed854daff9853c0cbeec1
This commit is contained in:
Horst Schirmeier
2015-01-21 00:32:48 +01:00
parent d58694521c
commit 412ecbba63

View File

@ -271,6 +271,7 @@ void DatabaseCampaign::load_completed_pilots(std::vector<Database::Variant> &var
sql << "SELECT pilot_id, COUNT(*) FROM fsppilot p"
<< " JOIN " << db_connect.result_table() << " r ON r.pilot_id = p.id"
<< " WHERE variant_id in (" << variant_str.str() << ")"
<< " AND fspmethod_id IN (SELECT id FROM fspmethod WHERE method LIKE '" << m_fspmethod << "')"
<< " GROUP BY pilot_id ";
MYSQL_RES *ids = db->query_stream(sql.str().c_str());
MYSQL_ROW row;