Skip to content
Permalink
Browse files

fix #2555

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13059 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Mar 15, 2010
1 parent 0967dca commit 9d6fe10436b961ecf4aa81f2bc7a60316d60a0ff
Showing with 9 additions and 1 deletion.
  1. +7 −0 src/providers/postgres/qgspostgresprovider.cpp
  2. +2 −1 src/providers/postgres/qgspostgresprovider.h
@@ -690,6 +690,7 @@ void QgsPostgresProvider::select( QgsAttributeList fetchAttributes, QgsRectangle
return;

mFetching = true;
mFetched = 0;
}

bool QgsPostgresProvider::nextFeature( QgsFeature& feature )
@@ -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;
}

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

mFeatureQueue.pop();
mFetched++;

feature.setValid( true );
return true;
@@ -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;

0 comments on commit 9d6fe10

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