Skip to content

Commit

Permalink
Never return a feature if the fid is negative
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Nov 15, 2017
1 parent f25ea5b commit 74e3323
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/providers/virtual/qgsvirtuallayerfeatureiterator.cpp
Expand Up @@ -110,7 +110,10 @@ QgsVirtualLayerFeatureIterator::QgsVirtualLayerFeatureIterator( QgsVirtualLayerF
{
if ( request.filterType() == QgsFeatureRequest::FilterFid )
{
offset = QStringLiteral( " LIMIT 1 OFFSET %1" ).arg( request.filterFid() );
if ( request.filterFid() >= 0 )
offset = QStringLiteral( " LIMIT 1 OFFSET %1" ).arg( request.filterFid() );
else // never return a feature if the id is negative
offset = QStringLiteral( " LIMIT 0" );
}
}

Expand Down

0 comments on commit 74e3323

Please sign in to comment.