From ff96258e69bc20bb1b8a4214342ac9127d0b49c2 Mon Sep 17 00:00:00 2001 From: motodiary Date: Mon, 27 May 2024 16:28:54 +0800 Subject: [PATCH] Modify the alias after EXCLUDED in SQL to field name --- ...-after-EXCLUDED-in-SQL-to-field-name.patch | 65 +++++++++++++++++++ slurm.spec | 6 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 0030-Modify-the-alias-after-EXCLUDED-in-SQL-to-field-name.patch diff --git a/0030-Modify-the-alias-after-EXCLUDED-in-SQL-to-field-name.patch b/0030-Modify-the-alias-after-EXCLUDED-in-SQL-to-field-name.patch new file mode 100644 index 0000000..fd27539 --- /dev/null +++ b/0030-Modify-the-alias-after-EXCLUDED-in-SQL-to-field-name.patch @@ -0,0 +1,65 @@ +From 741fb77348cef0f2b9886e31039bf5d7ea05a30b Mon Sep 17 00:00:00 2001 +From: motodiary +Date: Mon, 27 May 2024 16:26:19 +0800 +Subject: [PATCH] Modify the alias after EXCLUDED in SQL to field name + +--- + .../accounting_storage/pgsql/as_pgsql_assoc.c | 4 ++-- + .../accounting_storage/pgsql/as_pgsql_rollup.c | 12 ++++++------ + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c b/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c +index 373cc56..c92c07c 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_assoc.c +@@ -192,8 +192,8 @@ static char *rassoc_req_inx[] = { + "lft", + "acct", + "parent_acct", +- "user", +- "partition" ++ "\"user\"", ++ "\"partition\"" + }; + + enum { +diff --git a/src/plugins/accounting_storage/pgsql/as_pgsql_rollup.c b/src/plugins/accounting_storage/pgsql/as_pgsql_rollup.c +index bcf369f..9cb6b23 100755 +--- a/src/plugins/accounting_storage/pgsql/as_pgsql_rollup.c ++++ b/src/plugins/accounting_storage/pgsql/as_pgsql_rollup.c +@@ -1955,7 +1955,7 @@ extern int as_pgsql_nonhour_rollup(pgsql_conn_t *pgsql_conn, + "%ld, sum(alloc_secs) AS ASUM from \"%s_%s\" where " + "(time_start < %ld AND time_start >= %ld) " + "group by id, id_tres on CONFLICT (id,id_tres,time_start) do update set " +- "mod_time=%ld, alloc_secs=EXCLUDED.ASUM;", ++ "mod_time=%ld, alloc_secs=EXCLUDED.alloc_secs;", + cluster_name, + run_month ? assoc_month_table : assoc_day_table, + now, now, curr_start, +@@ -2010,10 +2010,10 @@ extern int as_pgsql_nonhour_rollup(pgsql_conn_t *pgsql_conn, + "(time_start < %ld AND time_start >= %ld) " + "group by deleted, id_tres " + "on conflict (id_tres,time_start) do update set " +- "mod_time=%ld, count=exclude.CPU, " +- "alloc_secs=exclude.ASUM, down_secs=exclude.DSUM, " +- "pdown_secs=exclude.PDSUM, idle_secs=exclude.ISUM, " +- "over_secs=exclude.OSUM, plan_secs=exclude.PSUM;", ++ "mod_time=%ld, count=EXCLUDED.count, " ++ "alloc_secs=EXCLUDED.alloc_secs, down_secs=EXCLUDED.down_secs, " ++ "pdown_secs=EXCLUDED.pdown_secs, idle_secs=EXCLUDED.idle_secs, " ++ "over_secs=EXCLUDED.over_secs, plan_secs=EXCLUDED.plan_secs;", + cluster_name, + run_month ? cluster_month_table : cluster_day_table, + now, now, curr_start, +@@ -2049,7 +2049,7 @@ extern int as_pgsql_nonhour_rollup(pgsql_conn_t *pgsql_conn, + "from \"%s_%s\" where (time_start < %ld AND " + "time_start >= %ld) group by id, id_tres " + "on conflict (id,id_tres,time_start) do update set " +- "mod_time=%ld, alloc_secs=exclude.ASUM;", ++ "mod_time=%ld, alloc_secs=EXCLUDED.alloc_secs;", + cluster_name, + run_month ? wckey_month_table : + wckey_day_table, +-- +2.33.0 + diff --git a/slurm.spec b/slurm.spec index 9954f51..08c474e 100644 --- a/slurm.spec +++ b/slurm.spec @@ -1,6 +1,6 @@ Name: slurm Version: 21.08.8 -%define rel 32 +%define rel 33 Release: %{rel}%{?dist} Summary: Slurm Workload Manager @@ -45,6 +45,7 @@ Patch26: 0026-Remove-excess-double-quotes-in-assoc-table.patch Patch27: 0027-Adjusting-procedures.patch Patch28: 0028-modify-the-field-type-of-info-in-txn_table.patch Patch29: 0029-add-partition-default-value-in-job_table.patch +Patch30: 0030-Modify-the-alias-after-EXCLUDED-in-SQL-to-field-name.patch # build options .rpmmacros options change to default action # ==================== ==================== ======================== @@ -737,6 +738,9 @@ rm -rf %{buildroot} %systemd_postun_with_restart slurmdbd.service %changelog +* Mon May 27 2024 Xing Liu - 21.08.8-33 +- Modify the alias after EXCLUDED in SQL to field name + * Mon May 27 2024 Xing Liu - 21.08.8-32 - add partition default value in job_table -- Gitee