Skip to content

Commit

Permalink
fix #2555
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13059 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 15, 2010
1 parent 0967dca commit 9d6fe10
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -690,6 +690,7 @@ void QgsPostgresProvider::select( QgsAttributeList fetchAttributes, QgsRectangle
return;

mFetching = true;
mFetched = 0;
}

bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
Expand Down Expand Up @@ -731,6 +732,11 @@ bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
QgsDebugMsg( "End of features" );
connectionRO->closeCursor( cursorName );
mFetching = false;
if ( featuresCounted != mFetched )
{
QgsDebugMsg( QString( "feature count adjusted from %1 to %2" ).arg( featuresCounted ).arg( mFetched ) );
featuresCounted = mFetched;
}
return false;
}

Expand All @@ -748,6 +754,7 @@ bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
feature.setAttributeMap( mFeatureQueue.front().attributeMap() );

mFeatureQueue.pop();
mFetched++;

feature.setValid( true );
return true;
Expand Down
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresprovider.h
Expand Up @@ -364,7 +364,8 @@ class QgsPostgresProvider : public QgsVectorDataProvider
*/
bool parseDomainCheckConstraint( QStringList& enumValues, const QString& attributeName ) const;

bool mFetching; // true if a cursor was declared
bool mFetching; // true if a cursor was declared
int mFetched; // number of retrieved features
std::vector < QgsFeature > features;
QgsFieldMap attributeFields;
QString mDataComment;
Expand Down

0 comments on commit 9d6fe10

Please sign in to comment.