Skip to content
Permalink
Browse files
fix QgsSpatiaLiteProvider::uniqueValues, when there is a subset string
  • Loading branch information
jef-n committed Mar 22, 2012
1 parent 587b338 commit 51ece3c0c4be93145aef69f09b432a32c0ff4c41
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -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 );

0 comments on commit 51ece3c

Please sign in to comment.