File tree 2 files changed +11
-3
lines changed
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 )
209
209
if ( mRewind )
210
210
{
211
211
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
+ }
214
220
}
215
- else if ( !mQry .next () )
221
+ if ( !mQry .next () )
216
222
{
217
223
return false ;
218
224
}
@@ -444,6 +450,7 @@ bool QgsOracleFeatureIterator::openQuery( QString whereClause )
444
450
query += QString ( " WHERE %1" ).arg ( whereClause );
445
451
446
452
QgsDebugMsg ( QString ( " Fetch features: %1" ).arg ( query ) );
453
+ mSql = query;
447
454
if ( !QgsOracleProvider::exec ( mQry , query ) )
448
455
{
449
456
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
84
84
bool mExpressionCompiled ;
85
85
bool mFetchGeometry ;
86
86
QgsAttributeList mAttributeList ;
87
+ QString mSql ;
87
88
};
88
89
89
90
#endif // QGSORACLEFEATUREITERATOR_H
You can’t perform that action at this time.
0 commit comments