From ac859eb57638ccac6151bfe8a505a2eabb61a9a8 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Tue, 20 Oct 2020 17:14:38 +0200 Subject: [PATCH] Make sure we query empty instead of null --- src/collection/collectionquery.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/collection/collectionquery.cpp b/src/collection/collectionquery.cpp index f8162c6d2..19b4b0dac 100644 --- a/src/collection/collectionquery.cpp +++ b/src/collection/collectionquery.cpp @@ -136,6 +136,10 @@ void CollectionQuery::AddWhere(const QString &column, const QVariant &value, con if (value.type() == QVariant::Int) { where_clauses_ << QString("%1 %2 %3").arg(column, op, value.toString()); } + else if (value.type() == QVariant::String && value.toString().isNull()) { + where_clauses_ << QString("%1 %2 ?").arg(column, op); + bound_values_ << QString(""); + } else { where_clauses_ << QString("%1 %2 ?").arg(column, op); bound_values_ << value;