I've found two instances where queries were concatenated without a proper
semicolon, resulting in a query error (first and second hunk of the patch).
By checking the source, I've also found in the same function a query which was
simply skipped because the output was overwritten instead of being appended
(first hunk). After a cursory read of the file I didn't seem to find other
occurrences.
See the attached patch.
diff -ru slurm-2.4.0-0.pre1.Orig/src/plugins/accounting_storage/pgsql/as_pg_job.c slurm-2.4.0-0.pre1/src/plugins/accounting_storage/pgsql/as_pg_job.c
--- slurm-2.4.0-0.pre1.Orig/src/plugins/accounting_storage/pgsql/as_pg_job.c 2011-10-24 19:39:19.000000000 +0200
+++ slurm-2.4.0-0.pre1/src/plugins/accounting_storage/pgsql/as_pg_job.c 2011-11-18 11:28:18.248282572 +0100
@@ -1041,9 +1041,9 @@
} else
job_db_inx = job_ptr->db_index;
- query = xstrdup_printf(
+ xstrfmtcat(query,
"UPDATE %s.%s SET time_suspended=%d-time_suspended, state=%d "
- "WHERE job_db_inx=%d", pg_conn->cluster_name, job_table,
+ "WHERE job_db_inx=%d;", pg_conn->cluster_name, job_table,
(int)job_ptr->suspend_time,
(int)(job_ptr->job_state & JOB_STATE_BASE),
(int)job_ptr->db_index);
@@ -1067,7 +1067,7 @@
if(rc == SLURM_SUCCESS) {
query = xstrdup_printf(
"UPDATE %s.%s SET time_suspended=%d-time_suspended, "
- "state=%d WHERE job_db_inx=%d and time_end=0",
+ "state=%d WHERE job_db_inx=%d and time_end=0;",
pg_conn->cluster_name,
step_table, (int)job_ptr->suspend_time,
(int)job_ptr->job_state, (int)job_ptr->db_index);