*** empty log message ***

svn path=/trunk/boinc/; revision=4238
This commit is contained in:
David Anderson 2004-09-24 20:48:07 +00:00
parent e6cdca41e0
commit 45b76a2180
5 changed files with 43 additions and 9 deletions

View File

@ -17689,5 +17689,24 @@ David 24 Sept 2004
This required adding the set of CORE_VERSIONs to shared mem
sched/
handle_request.C
sched_config.C,h
sched_shmem.C,h
David 24 Sept 2004
- db_dump: use mysql_use_result() instead of mysql_store_result()
for the enumeration of users.
Otherwise it has to store the entire result set in memory,
which could be prohibitive.
NOTE: still have to use mysql_store_result() for hosts
because of the user lookup to get show_hosts flag.
Could deal with this by doing a join.
- added use_use_result arg to DB_BASE::enumerate() (default false)
- change printfs to log_messages.printf in db_dump
- db_dump: don't show user host list
(can't do this if use mysql_use_result())
db/
db_base.C,h
sched/
db_dump.C

View File

@ -183,7 +183,7 @@ int DB_BASE::lookup_id(int id) {
return 0;
}
int DB_BASE::enumerate(char* clause) {
int DB_BASE::enumerate(char* clause, bool use_use_result) {
int x;
char query[MAX_QUERY_LEN];
MYSQL_ROW row;
@ -200,10 +200,14 @@ int DB_BASE::enumerate(char* clause) {
x = db->do_query(query);
if (x) return mysql_errno(db->mysql);
// can't use mysql_use_results() here; if you do,
// if you use mysql_use_result() here,
// any other transactions will fail
//
cursor.rp = mysql_store_result(db->mysql);
if (use_use_result) {
cursor.rp = mysql_use_result(db->mysql);
} else {
cursor.rp = mysql_store_result(db->mysql);
}
if (!cursor.rp) return mysql_errno(db->mysql);
}
row = mysql_fetch_row(cursor.rp);

View File

@ -86,7 +86,7 @@ public:
int get_field_int(char*, int&);
int lookup_id(int id);
int lookup(char*);
int enumerate(char* clause="");
int enumerate(char* clause="", bool use_use_result=false);
int end_enumerate();
int count(int&, char* clause="");
int sum(double&, char* field, char* clause="");

View File

@ -127,11 +127,17 @@ int OUTPUT::parse(FILE* in) {
} else if (!strcmp(buf2, "zip")) {
compression = COMPRESSION_ZIP;
} else {
printf("unrecognized: %s", buf);
log_messages.printf(
SCHED_MSG_LOG::CRITICAL,
"unrecognized compression type: %s", buf
);
}
continue;
}
printf("unrecognized: %s", buf);
log_messages.printf(
SCHED_MSG_LOG::CRITICAL,
"OUTPUT::parse: unrecognized: %s", buf
);
}
return ERR_XML_PARSE;
}
@ -213,7 +219,10 @@ public:
f = fopen(filename, "w");
if (!f) {
log_messages.printf(SCHED_MSG_LOG::CRITICAL, "db_dump: Couldn't open %s for output\n", filename);
log_messages.printf(
SCHED_MSG_LOG::CRITICAL,
"Couldn't open %s for output\n", filename
);
}
fprintf(f,
"<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<%s>\n", tag.c_str()
@ -396,6 +405,7 @@ void write_user(USER& user, FILE* f, bool detail) {
" <has_profile/>\n"
);
}
#if 0
if (detail && user.show_hosts) {
sprintf(buf, "where userid=%d", user.id);
while (!host.enumerate(buf)) {
@ -404,6 +414,7 @@ void write_user(USER& user, FILE* f, bool detail) {
}
}
}
#endif
fprintf(f,
"</user>\n"
);
@ -630,7 +641,7 @@ int ENUMERATION::make_it_happen(char* output_dir) {
switch(table) {
case TABLE_USER:
n = 0;
while (!user.enumerate(clause)) {
while (!user.enumerate(clause, true)) {
for (i=0; i<outputs.size(); i++) {
OUTPUT& out = outputs[i];
if (sort == SORT_ID && out.recs_per_file) {

View File

@ -640,7 +640,7 @@ void notify_if_newer_core_version(
cvp = ss.lookup_core_version(platform.id);
if (cvp && cvp->version_num > req_version) {
sprintf(reply.message,
"A new version (%d.%2d) of the BOINC core client is available from this project's web site.",
"A new version (%d.%02d) of the BOINC core client is available from this project's web site.",
cvp->version_num/100,
cvp->version_num%100
);