Skip to content

Commit 15d2b36

Browse files
committedMay 24, 2018
[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)
1 parent f5a9e6b commit 15d2b36

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎src/providers/oracle/qgsoraclefeatureiterator.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ QgsOracleFeatureIterator::QgsOracleFeatureIterator( QgsOracleFeatureSource* sour
5757
}
5858
}
5959

60+
// ensure that all attributes required for order by are fetched
61+
const QSet< QString > orderByAttributes = mRequest.orderBy().usedAttributes();
62+
for ( const QString &attr : orderByAttributes )
63+
{
64+
int attrIndex = mSource->mFields.fieldNameIndex( attr );
65+
if ( !mAttributeList.contains( attrIndex ) )
66+
mAttributeList << attrIndex;
67+
}
6068
}
6169
else
6270
mAttributeList = mSource->mFields.allAttributesList();

0 commit comments

Comments
 (0)
Please sign in to comment.