Skip to content
Permalink
Browse files

[oracle] Ensure that all attributes required for order by are fetched

Fixes potentially broken iterator sorting with oracle provider when
a subset of attributes is fetched

(cherry-picked from 89a84f0)
  • Loading branch information
nyalldawson committed Apr 15, 2018
1 parent f5a9e6b commit 15d2b36839df5d7ef0258d7c2113d62facec879c
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/providers/oracle/qgsoraclefeatureiterator.cpp
@@ -57,6 +57,14 @@ QgsOracleFeatureIterator::QgsOracleFeatureIterator( QgsOracleFeatureSource* sour
}
}

// ensure that all attributes required for order by are fetched
const QSet< QString > orderByAttributes = mRequest.orderBy().usedAttributes();
for ( const QString &attr : orderByAttributes )
{
int attrIndex = mSource->mFields.fieldNameIndex( attr );
if ( !mAttributeList.contains( attrIndex ) )
mAttributeList << attrIndex;
}
}
else
mAttributeList = mSource->mFields.allAttributesList();

0 comments on commit 15d2b36

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