File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -209,10 +209,16 @@ bool QgsOracleFeatureIterator::fetchFeature( QgsFeature& feature )
209209 if ( mRewind )
210210 {
211211 mRewind = false ;
212- if ( !mQry .first () )
213- return true ;
212+ if ( !QgsOracleProvider::exec ( mQry , mSql ) )
213+ {
214+ QgsMessageLog::logMessage ( QObject::tr ( " Fetching features failed.\n SQL:%1\n Error: %2" )
215+ .arg ( mQry .lastQuery () )
216+ .arg ( mQry .lastError ().text () ),
217+ QObject::tr ( " Oracle" ) );
218+ return false ;
219+ }
214220 }
215- else if ( !mQry .next () )
221+ if ( !mQry .next () )
216222 {
217223 return false ;
218224 }
@@ -444,6 +450,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
444450 query += QString ( " WHERE %1" ).arg ( whereClause );
445451
446452 QgsDebugMsg ( QString ( " Fetch features: %1" ).arg ( query ) );
453+ mSql = query;
447454 if ( !QgsOracleProvider::exec ( mQry , query ) )
448455 {
449456 QgsMessageLog::logMessage ( QObject::tr ( " Fetching features failed.\n SQL:%1\n Error: %2" )
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ class QgsOracleFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Qgs
8484 bool mExpressionCompiled ;
8585 bool mFetchGeometry ;
8686 QgsAttributeList mAttributeList ;
87+ QString mSql ;
8788};
8889
8990#endif // QGSORACLEFEATUREITERATOR_H
You can’t perform that action at this time.
0 commit comments