diff --git a/db/boinc_db.C b/db/boinc_db.C index 44c8a8d245..8f7193bf51 100644 --- a/db/boinc_db.C +++ b/db/boinc_db.C @@ -605,7 +605,7 @@ int DB_TRANSITIONER_QUEUE::enumerate_queue_entries(int transition_time, int ntot " wu.file_delete_state, " " wu.assimilate_state, " " wu.target_nresults, " - " wu.result_template, " + " wu.result_template_file, " " res.id AS res_id, " " res.report_deadline AS res_report_deadline, " " res.server_state AS res_server_state, " @@ -673,6 +673,7 @@ void DB_TRANSITIONER_QUEUE::parse_entry(MYSQL_RES *result, MYSQL_ROW& row) { fetch_field_value(result, row, "file_delete_state", file_delete_state); fetch_field_value(result, row, "assimilate_state", assimilate_state); fetch_field_value(result, row, "target_nresults", target_nresults); + fetch_field_value(result, row, "result_template_file", result_template_file, sizeof(result_template_file)); parse_result(result, row); } @@ -704,14 +705,22 @@ int DB_TRANSITIONER_QUEUE::seek_first_result() { int DB_TRANSITIONER_QUEUE::seek_next_result() { int retval; + int temp_workunit_id; MYSQL_ROW row; row = mysql_fetch_row(cursor.rp); if (!row) { - retval = seek_first_result(); + seek_first_result(); + retval = -1; } else { - parse_result(cursor.rp, row); - retval = 0; + fetch_field_value(result, row, "id", temp_workunit_id); + if ( temp_workunit_id != current_entry_workunit_id ) { + seek_first_result(); + retval = -1; + } else { + parse_result(cursor.rp, row); + retval = 0; + } } return retval; diff --git a/db/boinc_db.h b/db/boinc_db.h index 0de77f77a4..bdf7e9b27e 100755 --- a/db/boinc_db.h +++ b/db/boinc_db.h @@ -442,6 +442,7 @@ struct TRANSITIONER_QUEUE { int file_delete_state; int assimilate_state; int target_nresults; + char result_template_file[256]; int res_id; int res_report_deadline; int res_server_state;