Skip to content

Commit 51ece3c

Browse files
committedMar 22, 2012
fix QgsSpatiaLiteProvider::uniqueValues, when there is a subset string
1 parent 587b338 commit 51ece3c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3508,13 +3508,15 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV
35083508
}
35093509
const QgsField& fld = fieldIt.value();
35103510

3511-
sql = QString( "SELECT DISTINCT %1 FROM %2 ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery );
3511+
sql = QString( "SELECT DISTINCT %1 FROM %2" ).arg( quotedIdentifier( fld.name() ) ).arg( mQuery );
35123512

35133513
if ( !mSubsetString.isEmpty() )
35143514
{
35153515
sql += " WHERE ( " + mSubsetString + ")";
35163516
}
35173517

3518+
sql += QString( " ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) );
3519+
35183520
if ( limit >= 0 )
35193521
{
35203522
sql += QString( " LIMIT %1" ).arg( limit );

0 commit comments

Comments
 (0)
Please sign in to comment.