mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
Merge pull request #5437 from m-kuhn/pgquick
[postgres] respect empty FilterFids list
This commit is contained in:
commit
bb8bad06c0
@ -36,6 +36,13 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
, mLastFetch( false )
|
||||
, mFilterRequiresGeometry( false )
|
||||
{
|
||||
if ( request.filterType() == QgsFeatureRequest::FilterFids && request.filterFids().isEmpty() )
|
||||
{
|
||||
mClosed = true;
|
||||
iteratorClosed();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !source->mTransactionConnection )
|
||||
{
|
||||
mConn = QgsPostgresConnPool::instance()->acquireConnection( mSource->mConnInfo );
|
||||
@ -65,7 +72,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
catch ( QgsCsException & )
|
||||
{
|
||||
// can't reproject mFilterRect
|
||||
mClosed = true;
|
||||
close();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -136,6 +143,8 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
}
|
||||
}
|
||||
|
||||
if ( !mClosed )
|
||||
{
|
||||
QStringList orderByParts;
|
||||
|
||||
mOrderByCompiled = true;
|
||||
@ -176,7 +185,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
else
|
||||
#endif
|
||||
{
|
||||
mOrderByCompiled = false;
|
||||
mOrderByCompiled = mRequest.orderBy().isEmpty();
|
||||
}
|
||||
|
||||
// ensure that all attributes required for order by are fetched
|
||||
@ -226,8 +235,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
|
||||
if ( !success )
|
||||
{
|
||||
close();
|
||||
mClosed = true;
|
||||
iteratorClosed();
|
||||
}
|
||||
}
|
||||
|
||||
mFetched = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user