Skip to content
Permalink
Browse files

Never return a feature if the fid is negative

  • Loading branch information
pblottiere committed Nov 15, 2017
1 parent f25ea5b commit 74e3323db62156a84350c37298d3a2649e0293db
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/providers/virtual/qgsvirtuallayerfeatureiterator.cpp
@@ -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" );
}
}

0 comments on commit 74e3323

Please sign in to comment.
You can’t perform that action at this time.