diff --git a/0026-Remove-excess-double-quotes-in-assoc-table.patch b/0026-Remove-excess-double-quotes-in-assoc-table.patch new file mode 100644 index 0000000000000000000000000000000000000000..c451ca5e7e3d89eb41a476ce7aff8c926647a826 --- /dev/null +++ b/0026-Remove-excess-double-quotes-in-assoc-table.patch @@ -0,0 +1,66 @@ +From 4d02bc6db31979f5fc4d6e1285a81e66567069a8 Mon Sep 17 00:00:00 2001 +From: motodiary +Date: Thu, 23 May 2024 14:29:22 +0800 +Subject: [PATCH] Remove excess double quotes in assoc table + +--- + src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c | 6 +++--- + .../accounting_storage/pgsql/as_pgsql_jobacct_process.c | 4 ++-- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c b/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c +index 4c7d7e3..373cc56 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c +@@ -399,7 +399,7 @@ static int _make_sure_users_have_default( + pgsql_row row; + + query = xstrdup_printf( +- "select distinct is_def, acct from " ++ "select distinct is_def, acct, creation_time from " + "\"%s_%s\" where \"user\"='%s' and deleted=0 " + "ORDER BY is_def desc, creation_time desc " + "LIMIT 1;", +@@ -2630,7 +2630,7 @@ extern int as_pgsql_add_assocs(pgsql_conn_t *pgsql_conn, uint32_t uid, + xstrcat(cols, ", \"user\""); + xstrfmtcat(vals, ", '%s'", object->user); + xstrfmtcat(update, " AND \"user\"='%s'", object->user); +- xstrfmtcat(extra, ", \"user\"='%s'", object->user); ++ xstrfmtcat(extra, ", user='%s'", object->user); // it in a string, don't add quotes + + /* We need to give a partition whether it be + * '' or the actual partition name given +@@ -2640,7 +2640,7 @@ extern int as_pgsql_add_assocs(pgsql_conn_t *pgsql_conn, uint32_t uid, + xstrcat(cols, ", \"partition\""); + xstrfmtcat(vals, ", '%s'", part); + xstrfmtcat(update, " AND \"partition\"='%s'", part); +- xstrfmtcat(extra, ", \"partition\"='%s'", part); ++ xstrfmtcat(extra, ", partition='%s'", part); // it in a string, don't add quotes + if (!added_user_list) + added_user_list = list_create(NULL); + if (!list_find_first(added_user_list, +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_jobacct_process.c b/src/plugins/accounting_storage/pgsql/as_pgsql_jobacct_process.c +index 0612715..e7d650b 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_jobacct_process.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_jobacct_process.c +@@ -569,7 +569,7 @@ static int _cluster_get_jobs(pgsql_conn_t *pgsql_conn, + "on t1.id_assoc=t2.id_assoc " + "left join \"%s_%s\" as t3 " + "on t1.id_resv=t3.id_resv AND " +- "((t1.time_start AND " ++ "((t1.time_start > 0 AND " + "(t3.time_start < t1.time_start AND " + "(t3.time_end >= t1.time_start OR " + "t3.time_end = 0))) OR " +@@ -921,7 +921,7 @@ static int _cluster_get_jobs(pgsql_conn_t *pgsql_conn, + query = xstrdup_printf("select %s from \"%s_%s\" as t1 " + "where t1.job_db_inx=%s AND " + "t1.time_start <= %ld AND " +- "(!t1.time_end OR t1.time_end >= %ld)", ++ "(t1.time_end = 0 OR t1.time_end >= %ld)", + step_fields, cluster_name, + step_table, db_inx_char, + job_cond->usage_end, +-- +2.33.0 + diff --git a/slurm.spec b/slurm.spec index a67926256c0fca7e2518f21b0d1f7ad73fcad05a..c6c41412ed63bc45169adf2c8c271609c33689b2 100644 --- a/slurm.spec +++ b/slurm.spec @@ -1,6 +1,6 @@ Name: slurm Version: 21.08.8 -%define rel 28 +%define rel 29 Release: %{rel}%{?dist} Summary: Slurm Workload Manager @@ -41,6 +41,7 @@ Patch22: 0022-add-SQLRowCount-exception-handling.patch Patch23: 0023-modify-step-table.patch Patch24: 0024-update-the-implementation-of-obtaining-the-last-resu.patch Patch25: 0025-Adjusting-the-commit-off-setting-position.patch +Patch26: 0026-Remove-excess-double-quotes-in-assoc-table.patch # build options .rpmmacros options change to default action # ==================== ==================== ======================== @@ -733,6 +734,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart slurmdbd.service %changelog +* Thu May 23 2024 Xing Liu - 21.08.8-29 +- Remove excess double quotes in assoc table + * Thu May 23 2024 Xing Liu - 21.08.8-28 - Adjusting the commit off setting position