diff --git a/src/core/qgsogcutils.cpp b/src/core/qgsogcutils.cpp index 891ae45799e6..16a3d25f3e1f 100644 --- a/src/core/qgsogcutils.cpp +++ b/src/core/qgsogcutils.cpp @@ -2318,7 +2318,7 @@ static bool isGeometryColumn( const QgsExpressionNode *node ) const QgsExpressionNodeFunction *fn = static_cast( node ); QgsExpressionFunction *fd = QgsExpression::Functions()[fn->fnIndex()]; - return fd->name() == QLatin1String( "$geometry" ) || fn->referencedVariables().contains( QLatin1String( "geometry" ) ); + return fd->name() == QLatin1String( "$geometry" ) || ( fd->name() == QLatin1String( "var" ) && fn->referencedVariables().contains( QLatin1String( "geometry" ) ) ); } static QgsGeometry geometryFromConstExpr( const QgsExpressionNode *node )