mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 03:16:29 +03:00
fix(query_row_optional): do not treat rows with NULL as missing rows
Instead of treating NULL type error as absence of the row, handle NULL values with SQL. Previously we sometimes accidentally treated a single column being NULL as the lack of the whole row.
This commit is contained in:
@@ -201,7 +201,8 @@ impl MimeFactory {
|
||||
let (in_reply_to, references) = context
|
||||
.sql
|
||||
.query_row(
|
||||
"SELECT mime_in_reply_to, mime_references FROM msgs WHERE id=?",
|
||||
"SELECT mime_in_reply_to, IFNULL(mime_references, '')
|
||||
FROM msgs WHERE id=?",
|
||||
(msg.id,),
|
||||
|row| {
|
||||
let in_reply_to: String = row.get(0)?;
|
||||
|
||||
Reference in New Issue
Block a user