From f81105f707de3d8748cf90cfa3052ef41166ebc1 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 13 Apr 2015 23:58:59 -0700 Subject: [PATCH] create_work: show DB error messages --- lib/common_defs.h | 5 +++-- tools/create_work.cpp | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/common_defs.h b/lib/common_defs.h index 92483ae9bf..cd50472816 100644 --- a/lib/common_defs.h +++ b/lib/common_defs.h @@ -42,8 +42,9 @@ // restore permanent mode - used only in set_X_mode() GUI RPC // values of ACTIVE_TASK::scheduler_state and ACTIVE_TASK::next_scheduler_state -// "SCHEDULED" is synonymous with "executing" except when CPU throttling -// is in use. +// "SCHEDULED" doesn't mean the task is actually running; +// e.g. it won't be running if tasks are suspended or CPU throttling is in use +// #define CPU_SCHED_UNINITIALIZED 0 #define CPU_SCHED_PREEMPTED 1 #define CPU_SCHED_SCHEDULED 2 diff --git a/tools/create_work.cpp b/tools/create_work.cpp index f9ce67228d..e0aed1ea5f 100644 --- a/tools/create_work.cpp +++ b/tools/create_work.cpp @@ -442,7 +442,11 @@ int main(int argc, char** argv) { retval = wu.insert_batch(values); if (retval) { fprintf(stderr, - "wu.insert_batch() failed: %d\n", retval + "wu.insert_batch() failed: %d; size %d\n", + retval, (int)values.size() + ); + fprintf(stderr, + "MySQL error: %s\n", boinc_db.error_string() ); exit(1); } @@ -455,6 +459,9 @@ int main(int argc, char** argv) { fprintf(stderr, "wu.insert_batch() failed: %d\n", retval ); + fprintf(stderr, + "MySQL error: %s\n", boinc_db.error_string() + ); exit(1); } }