D20714: akonadi: fix some clazy warnings

Daniel Vrátil noreply at phabricator.kde.org
Tue Apr 23 10:33:44 BST 2019


dvratil added inline comments.

INLINE COMMENTS

> itemcreatehandler.cpp:402
>              mergeCondition.addValueCondition(PimItem::remoteIdColumn(), Query::Equals, item.remoteId());
> -            mergeCondition.addValueCondition(PimItem::gidColumn(), Query::Equals, QStringLiteral(""));
> +            mergeCondition.addValueCondition(PimItem::gidColumn(), Query::Equals, QString());
>              rootCondition.addCondition(mergeCondition);

@dfaure This looks suspicious. There's a difference in how this is translated in the SQL query: the original version gets translated into `... WHERE gid = ""`, while the new version gets translated into `... WHERE gid = NULL`, which is always `false` (a null never compares to another null). Even if you would change it to `IS NULL` this would still yield different results, since an empty value is not the same as a null value in SQL.

REPOSITORY
  R165 Akonadi

REVISION DETAIL
  https://phabricator.kde.org/D20714

To: dfaure, dvratil, vkrause
Cc: kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190423/8c182f6b/attachment.html>


More information about the kde-pim mailing list