Skip to content

Commit

Permalink
Fix caching aggregate expressions with @parent usage
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Oct 31, 2016
1 parent f438542 commit 1b2158d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() );
}
Expand Down

0 comments on commit 1b2158d

Please sign in to comment.