Skip to content
Permalink
Browse files

[oracle] Fix broken iterator rewind

On behalf of Faunalia, sponsored by ENEL

(cherry-picked from d785b90)
  • Loading branch information
nyalldawson committed Jul 6, 2016
1 parent 0c060bd commit 03074955cc93686b3cd0e6a96cae38392b9c0209
@@ -209,10 +209,16 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
if ( mRewind )
{
mRewind = false;
if ( !mQry.first() )
return true;
if ( !QgsOracleProvider::exec( mQry, mSql ) )
{
QgsMessageLog::logMessage( QObject::tr( "Fetching features failed.\nSQL:%1\nError: %2" )
.arg( mQry.lastQuery() )
.arg( mQry.lastError().text() ),
QObject::tr( "Oracle" ) );
return false;
}
}
else if ( !mQry.next() )
if ( !mQry.next() )
{
return false;
}
@@ -444,6 +450,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
query += QString( " WHERE %1" ).arg( whereClause );

QgsDebugMsg( QString( "Fetch features: %1" ).arg( query ) );
mSql = query;
if ( !QgsOracleProvider::exec( mQry, query ) )
{
QgsMessageLog::logMessage( QObject::tr( "Fetching features failed.\nSQL:%1\nError: %2" )
@@ -84,6 +84,7 @@ class QgsOracleFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Qgs
bool mExpressionCompiled;
bool mFetchGeometry;
QgsAttributeList mAttributeList;
QString mSql;
};

#endif // QGSORACLEFEATUREITERATOR_H

0 comments on commit 0307495

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