Skip to content
Permalink
Browse files

Fix caching aggregate expressions with @parent usage

  • Loading branch information
m-kuhn committed Oct 31, 2016
1 parent f438542 commit 1b2158d854870334a34278dc1c6776fa10205880
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/core/qgsexpression.cpp
@@ -701,8 +701,12 @@ static QVariant fcnAggregate( const QVariantList& values, const QgsExpressionCon
{
QString cacheKey = QStringLiteral( "aggfcn:%1:%2:%3:%4" ).arg( vl->id(), QString::number( aggregate ), subExpression, parameters.filter );

QgsExpression subExp( subExpression );
QgsExpression filterExp( parameters.filter );
if ( filterExp.referencedVariables().contains( "parent" ) || filterExp.referencedVariables().contains( QString() ) )
if ( filterExp.referencedVariables().contains( "parent" )
|| filterExp.referencedVariables().contains( QString() )
|| subExp.referencedVariables().contains( "parent" )
|| subExp.referencedVariables().contains( QString() ) )
{
cacheKey += ':' + qHash( context->feature() );
}

0 comments on commit 1b2158d

Please sign in to comment.
You can’t perform that action at this time.