You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-office/akonadi-server/files/akonadi-server-1.10.2-datas...

24 lines
939 B

commit d76aeb18fbc346e89481ce9b3157b4518e8485f7
Author: Volker Krause <vkrause@kde.org>
Date: Wed Jul 31 17:14:10 2013 +0200
Don't crash the server if all items already have the desired flags.
This case subsequently hits an assert in the query builder for an empty
IN condition.
diff --git a/server/src/storage/datastore.cpp b/server/src/storage/datastore.cpp
index 41a0927..40b8fe8 100644
--- a/server/src/storage/datastore.cpp
+++ b/server/src/storage/datastore.cpp
@@ -235,6 +235,9 @@ bool DataStore::doAppendItemsFlag( const PimItem::List &items, const Flag &flag,
appendItems << item;
}
+ if ( appendItems.isEmpty() )
+ return true; // all items have the desired flags already
+
QueryBuilder qb2( PimItemFlagRelation::tableName(), QueryBuilder::Insert );
qb2.setColumnValue( PimItemFlagRelation::leftColumn(), appendIds );
qb2.setColumnValue( PimItemFlagRelation::rightColumn(), flagIds );