Skip to content

Commit

Permalink
use createFieldEqualityExpression
Browse files Browse the repository at this point in the history
  • Loading branch information
roya0045 committed Dec 8, 2021
1 parent 8352736 commit 6b1c6be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -5489,8 +5489,7 @@ static QVariant fcnGetFeature( const QVariantList &values, const QgsExpressionCo
{
filterString.append( " AND " );
}
filterString.append( QStringLiteral( "( %1 = %2 )" ).arg( QgsExpression::quotedColumnRef( i.key() ),
QgsExpression::quotedString( i.value().toString() ) ) );
filterString.append( QgsExpression::createFieldEqualityExpression( i.key(), i.value() ) );
}
cacheValueKey = QStringLiteral( "getfeature:%1:%2" ).arg( featureSource->id(), filterString );
if ( context && context->hasCachedValue( cacheValueKey ) )
Expand All @@ -5516,8 +5515,7 @@ static QVariant fcnGetFeature( const QVariantList &values, const QgsExpressionCo
return context->cachedValue( cacheValueKey );
}

req.setFilterExpression( QStringLiteral( "%1=%2" ).arg( QgsExpression::quotedColumnRef( attribute ),
QgsExpression::quotedString( attVal.toString() ) ) );
req.setFilterExpression( QgsExpression::createFieldEqualityExpression( attribute, attVal ) );
}
req.setLimit( 1 );
req.setTimeout( 10000 );
Expand Down

0 comments on commit 6b1c6be

Please sign in to comment.