Make sure we query empty instead of null

This commit is contained in:
Jonas Kvinge 2020-10-20 17:14:38 +02:00
parent 2dfa171b6a
commit ac859eb576
1 changed files with 4 additions and 0 deletions

View File

@ -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;