mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
[oracle] Fix broken iterator rewind
On behalf of Faunalia, sponsored by ENEL
This commit is contained in:
parent
fe93e62175
commit
d785b904ac
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user