From 471bc0fa3d9ba0843efecf30a15d858e301612d8 Mon Sep 17 00:00:00 2001 From: Jimmy Christensen Date: Thu, 28 Nov 2024 17:40:56 +0100 Subject: [PATCH] [cuebot] Convert null value from job.str_os to empty string in SQL (#1600) **Link the Issue(s) this Pull Request is related to.** #1591 **Summarize your change.** This is a different take on the MR #1594 which only changes the SQL queries instead of the Java code. --- .../com/imageworks/spcue/dao/postgres/DispatchQuery.java | 2 +- .../com/imageworks/spcue/dao/postgres/FrameDaoJdbc.java | 2 +- .../spcue/dao/postgres/NestedWhiteboardDaoJdbc.java | 2 +- .../java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java index fec2f47ac..010294323 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/DispatchQuery.java @@ -530,7 +530,7 @@ private static final String replaceQueryForFifo(String query) { "str_user, " + "int_uid, " + "str_log_dir, " + - "str_os, " + + "COALESCE(str_os, '') AS str_os, " + "frame_name, " + "frame_state, " + "pk_frame, " + diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/FrameDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/FrameDaoJdbc.java index 1703664c7..c25e00874 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/FrameDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/FrameDaoJdbc.java @@ -348,7 +348,7 @@ public DispatchFrame mapRow(ResultSet rs, int rowNum) throws SQLException { "job.str_user,"+ "job.int_uid,"+ "job.str_log_dir,"+ - "job.str_os,"+ + "COALESCE(str_os, '') AS str_os, " + "frame.str_name AS frame_name, "+ "frame.str_state AS frame_state, "+ "frame.pk_frame, "+ diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/NestedWhiteboardDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/NestedWhiteboardDaoJdbc.java index 8c920c5a4..fdd147ca1 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/NestedWhiteboardDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/NestedWhiteboardDaoJdbc.java @@ -94,7 +94,7 @@ public CachedJobWhiteboardMapper(NestedJobWhiteboardMapper result) { "job.b_paused, " + "job.b_autoeat, " + "job.b_comment, " + - "job.str_os, " + + "COALESCE(str_os, '') AS str_os, " + "job.int_frame_count, " + "job.int_layer_count, " + "job_stat.int_waiting_count, " + diff --git a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java index 2a597cfeb..0e24ed1c8 100644 --- a/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java +++ b/cuebot/src/main/java/com/imageworks/spcue/dao/postgres/ProcDaoJdbc.java @@ -356,7 +356,7 @@ public VirtualProc mapRow(ResultSet rs, int rowNum) throws SQLException { "proc.int_virt_max_used,"+ "proc.int_virt_used,"+ "host.str_name AS host_name, " + - "job.str_os " + + "COALESCE(job.str_os, '') AS str_os " + "FROM " + "proc, " + "job, " + @@ -389,7 +389,7 @@ public VirtualProc findVirtualProc(FrameInterface frame) { "proc.*, " + "host.str_name AS host_name, " + "host.pk_alloc, " + - "job.str_os, " + + "COALESCE(job.str_os, '') AS str_os, " + "alloc.pk_facility " + "FROM " + "proc, " + @@ -530,7 +530,7 @@ public String getCurrentFrameId(ProcInterface p) { "SELECT " + "proc.*, " + "host.str_name AS host_name, " + - "job.str_os, " + + "COALESCE(job.str_os, '') AS str_os, " + "host.pk_alloc, " + "alloc.pk_facility " + "FROM " +