From b1ff13eb7d9ccaa9beecc4cd3ca0c103a83e3950 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+0x-r4bbit@users.noreply.github.com> Date: Wed, 14 Dec 2022 16:34:03 +0100 Subject: [PATCH] fix: ensure queries coalesce `album_id` value when scanning Otherwise databases with existing messages that don't have an `album_id` will run into and `converting NULL to string is unsupported` error. See: https://github.com/status-im/status-go/pull/3021#issuecomment-1351623814 --- protocol/message_persistence.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/message_persistence.go b/protocol/message_persistence.go index 5ce47996e..dcde65b7f 100644 --- a/protocol/message_persistence.go +++ b/protocol/message_persistence.go @@ -115,7 +115,7 @@ func (db sqlitePersistence) tableUserMessagesAllFieldsJoin() string { m1.sticker_hash, m1.image_payload, m1.image_type, - m1.album_id, + COALESCE(m1.album_id, ""), COALESCE(m1.audio_duration_ms,0), m1.community_id, m1.mentions,