From c425c26088f599b26308b36b5950560763753f5a Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 3 Feb 2023 18:33:15 +0300 Subject: db: read message text with null coalescing --- src/main/java/com/juick/service/MessagesServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java index ccace3a8..55a44bb9 100644 --- a/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -423,7 +423,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ public Message getReply(final int mid, final int rid) { var sql = """ SELECT replies.user_id, users.nick, - replies.replyto, replies.ts, replies.attach, replies.txt, COALESCE(q.txt,m.txt) as quote, + replies.replyto, replies.ts, replies.attach, replies.txt, COALESCE(q.txt,m.txt, '') as quote, COALESCE(q.user_id, m.user_id) AS to_uid, COALESCE(qu.nick, mu.nick) AS to_name, replies.updated_at, replies.user_uri as uri, q.user_uri AS to_uri, replies.reply_uri AS reply_uri, replies.html, q.reply_uri @@ -807,7 +807,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ messages.hidden, '' as tags, messages.repliesby, - messages.txt, '' as q, + COALESCE(messages.txt, '') txt, '' as q, messages.updated, 0 as to_uid, NULL as to_name, -- cgit v1.2.3