From fca0660c5d14338f56c0636639a890a8dc7faf35 Mon Sep 17 00:00:00 2001
From: Danny Auble <da@schedmd.com>
Date: Fri, 9 Dec 2011 09:39:58 -0800
Subject: [PATCH] Add slashes in front of derived exit code when modifying a
 job.

---
 NEWS                                                | 1 +
 src/plugins/accounting_storage/mysql/as_mysql_job.c | 8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/NEWS b/NEWS
index 9484615e241..c80f856cb95 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ documents those changes that are of interest to users and admins.
  -- Fixed issue with QOS preemption when adding new QOS.
  -- Fixed issue with comment field being used in a job finishing before it
     starts in accounting.
+ -- Add slashes in front of derived exit code when modifying a job.
 
 * Changes in SLURM 2.3.2
 ========================
diff --git a/src/plugins/accounting_storage/mysql/as_mysql_job.c b/src/plugins/accounting_storage/mysql/as_mysql_job.c
index de518b60164..2e03d6becc4 100644
--- a/src/plugins/accounting_storage/mysql/as_mysql_job.c
+++ b/src/plugins/accounting_storage/mysql/as_mysql_job.c
@@ -584,9 +584,11 @@ extern List as_mysql_modify_job(mysql_conn_t *mysql_conn, uint32_t uid,
 	if (job->derived_ec != NO_VAL)
 		xstrfmtcat(vals, ", derived_ec=%u", job->derived_ec);
 
-	if (job->derived_es)
-		xstrfmtcat(vals, ", derived_es='%s'", job->derived_es);
-
+	if (job->derived_es) {
+		char *derived_es = slurm_add_slash_to_quotes(job->derived_es);
+		xstrfmtcat(vals, ", derived_es='%s'", derived_es);
+		xfree(derived_es);
+	}
 	if (!vals) {
 		errno = SLURM_NO_CHANGE_IN_DATA;
 		error("No change specified for job modification");
-- 
GitLab