- DB: use %u when writing result IDs in SQL queries;

this is to support SETI@home, which ran out of result IDs
    and changed the DB field type to int unsigned.
    Note: eventually I'll make this change official
    and change the .h types as well.
- web: put <apps_selected> tags around <app_id> elements
    in project-specific prefs.


svn path=/trunk/boinc/; revision=24555
This commit is contained in:
David Anderson 2011-11-09 07:41:49 +00:00
parent 4cc8b3d4e8
commit 7c201eba3f
5 changed files with 33 additions and 12 deletions

View File

@ -8252,3 +8252,20 @@ Rom 8 Nov 2011
api/
boinc_opencl.cpp
David 8 Nov 2011
- DB: use %u when writing result IDs in SQL queries;
this is to support SETI@home, which ran out of result IDs
and changed the DB field type to int unsigned.
Note: eventually I'll make this change official
and change the .h types as well.
- web: put <apps_selected> tags around <app_id> elements
in project-specific prefs.
db/
boinc_db.cpp
db_base.cpp
sched/
sched_send.cpp
html/project.sample/
project_specific_prefs.inc

View File

@ -789,7 +789,7 @@ void DB_WORKUNIT::db_print(char* buf){
"rsc_fpops_est=%.15e, rsc_fpops_bound=%.15e, "
"rsc_memory_bound=%.15e, rsc_disk_bound=%.15e, "
"need_validate=%d, "
"canonical_resultid=%d, canonical_credit=%.15e, "
"canonical_resultid=%u, canonical_credit=%.15e, "
"transition_time=%d, delay_bound=%d, "
"error_mask=%d, file_delete_state=%d, assimilate_state=%d, "
"hr_class=%d, opaque=%.15e, "
@ -1055,7 +1055,7 @@ void DB_ASSIGNMENT::db_print(char* buf) {
"target_type=%d, "
"multi=%d, "
"workunitid=%d, "
"resultid=%d",
"resultid=%u",
create_time,
target_id,
target_type,
@ -1648,7 +1648,7 @@ int DB_VALIDATOR_ITEM_SET::update_workunit(WORKUNIT& wu) {
"update workunit set need_validate=0, error_mask=%d, "
"assimilate_state=%d, transition_time=%d, "
"target_nresults=%d, "
"canonical_resultid=%d, canonical_credit=%.15e "
"canonical_resultid=%u, canonical_credit=%.15e "
"where id=%d",
wu.error_mask,
wu.assimilate_state,

View File

@ -207,7 +207,7 @@ int DB_BASE::lookup_id(int id) {
MYSQL_ROW row;
MYSQL_RES* rp;
sprintf(query, "select * from %s where id=%d", table_name, id);
sprintf(query, "select * from %s where id=%u", table_name, id);
retval = db->do_query(query);
if (retval) return retval;
@ -227,7 +227,7 @@ int DB_BASE::lookup_id(int id) {
int DB_BASE::update() {
char vals[MAX_QUERY_LEN], query[MAX_QUERY_LEN];
db_print(vals);
sprintf(query, "update %s set %s where id=%d", table_name, vals, get_id());
sprintf(query, "update %s set %s where id=%u", table_name, vals, get_id());
int retval = db->do_query(query);
if (retval) return retval;
if (db->affected_rows() != 1) return ERR_DB_NOT_FOUND;
@ -240,9 +240,9 @@ int DB_BASE::update() {
int DB_BASE::update_field(const char* clause, const char* where_clause) {
char query[MAX_QUERY_LEN];
if (where_clause) {
sprintf(query, "update %s set %s where id=%d and %s", table_name, clause, get_id(), where_clause);
sprintf(query, "update %s set %s where id=%u and %s", table_name, clause, get_id(), where_clause);
} else {
sprintf(query, "update %s set %s where id=%d", table_name, clause, get_id());
sprintf(query, "update %s set %s where id=%u", table_name, clause, get_id());
}
return db->do_query(query);
}
@ -252,7 +252,7 @@ int DB_BASE::update_field(const char* clause, const char* where_clause) {
int DB_BASE::delete_from_db() {
char vals[MAX_QUERY_LEN], query[MAX_QUERY_LEN];
db_print(vals);
sprintf(query, "delete from %s where id=%d", table_name, get_id());
sprintf(query, "delete from %s where id=%u", table_name, get_id());
return db->do_query(query);
}
@ -263,7 +263,7 @@ int DB_BASE::get_field_ints(const char* fields, int nfields, int* vals) {
MYSQL_RES* rp;
sprintf(query,
"select %s from %s where id=%d", fields, table_name, get_id()
"select %s from %s where id=%u", fields, table_name, get_id()
);
retval = db->do_query(query);
if (retval) return retval;
@ -287,7 +287,7 @@ int DB_BASE::get_field_str(const char* field, char* buf, int buflen) {
MYSQL_RES* rp;
sprintf(query,
"select %s from %s where id=%d", field, table_name, get_id()
"select %s from %s where id=%u", field, table_name, get_id()
);
retval = db->do_query(query);
if (retval) return retval;

View File

@ -49,7 +49,7 @@ define("MAX_GFX_CPU_PCT_DESC", tra("Maximum CPU % for graphics%10 ... 100%2", "<
define('APP_SELECT_DESC', tra('Run only the selected applications'));
define('ACCEPT_ANY_DESC', tra('If no work for selected applications is available, accept work from other applications?'));
// The following array is for app filtering; uncomment if you want it.
// stuff related to app filtering.
// Note: in this implementation, if a user selects all apps,
// no <app_id> elements are included in their prefs,
// which means that if the project adds a new app such users will run it also.
@ -143,7 +143,7 @@ function project_specific_prefs_parse_form(&$error) {
}
if (APP_SELECT_PREFS) {
$y = "";
$y = "<apps_selected>\n";
$some_unchecked = false;
foreach ($app_array as $app) {
$app_id = $app[0];
@ -154,6 +154,8 @@ function project_specific_prefs_parse_form(&$error) {
$some_unchecked = true;
}
}
$y .= "</apps_selected>\n";
if ($some_unchecked) {
$x .= $y;
}

View File

@ -267,6 +267,8 @@ double estimate_duration(WORKUNIT& wu, BEST_APP_VERSION& bav) {
return ed;
}
// TODO: use XML_PARSER
//
static void get_prefs_info() {
char buf[8096];
std::string str;