From 1d47dd274dd29bec42170d0cdf69cb9ac0b6686e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Thu, 24 Apr 2014 15:37:32 +0200 Subject: [PATCH 3/7] Fix retrieving of GID from SQL query result in FetchHelper This has been broken since the day one, but nobody noticed. I guess we were lucky enough to always query other arguments, so that ItemQueryPimItemGidColumn actually matched indexed of the GID column in query. Another reason why we need proper unit-tests on the server... --- server/src/handler/fetchhelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/handler/fetchhelper.cpp b/server/src/handler/fetchhelper.cpp index a6888a3..4d9f778 100644 --- a/server/src/handler/fetchhelper.cpp +++ b/server/src/handler/fetchhelper.cpp @@ -367,7 +367,7 @@ bool FetchHelper::fetchItems( const QByteArray &responseIdentifier ) } } if ( mFetchScope.gidRequested() ) { - const QByteArray gid = Utils::variantToByteArray( itemQuery.value( ItemQueryPimItemGidColumn ) ); + const QByteArray gid = Utils::variantToByteArray( extractQueryResult( itemQuery, ItemQueryPimItemGidColumn ) ); if ( !gid.isEmpty() ) { attributes.append( AKONADI_PARAM_GID " " + ImapParser::quote( gid ) ); } -- 1.9.3