From 292e197f16e42e54f8065637e581691d011afb30 Mon Sep 17 00:00:00 2001 From: Alessandro Pasotti Date: Fri, 20 Sep 2024 15:21:56 +0200 Subject: [PATCH] [expressions] Relation aggregate: fix cache key Fix #49469 --- src/core/expression/qgsexpressionfunction.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/expression/qgsexpressionfunction.cpp b/src/core/expression/qgsexpressionfunction.cpp index 4fcc203bdb28..c9defb41c305 100644 --- a/src/core/expression/qgsexpressionfunction.cpp +++ b/src/core/expression/qgsexpressionfunction.cpp @@ -877,11 +877,11 @@ static QVariant fcnAggregateRelation( const QVariantList &values, const QgsExpre parameters.filter = relation.getRelatedFeaturesFilter( f ); - QString cacheKey = QStringLiteral( "relagg:%1:%2:%3:%4:%5" ).arg( vl->id(), - QString::number( static_cast< int >( aggregate ) ), - subExpression, - parameters.filter, - orderBy ); + const QString cacheKey = QStringLiteral( "relagg:%1%:%2:%3:%4:%5:%6" ).arg( relationId, vl->id(), + QString::number( static_cast< int >( aggregate ) ), + subExpression, + parameters.filter, + orderBy ); if ( context->hasCachedValue( cacheKey ) ) return context->cachedValue( cacheKey );