Skip to content

Commit

Permalink
fix QgsSpatiaLiteProvider::uniqueValues, when there is a subset string
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 22, 2012
1 parent 587b338 commit 51ece3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -3508,13 +3508,15 @@ void QgsSpatiaLiteProvider::uniqueValues( int index, QList < QVariant > &uniqueV
}
const QgsField& fld = fieldIt.value();

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

if ( !mSubsetString.isEmpty() )
{
sql += " WHERE ( " + mSubsetString + ")";
}

sql += QString( " ORDER BY %1" ).arg( quotedIdentifier( fld.name() ) );

if ( limit >= 0 )
{
sql += QString( " LIMIT %1" ).arg( limit );
Expand Down

0 comments on commit 51ece3c

Please sign in to comment.