Skip to content

Commit

Permalink
also fix QgsPostgresProvider::uniqueValues() and ::parseEnumRange()
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11907 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 3, 2009
1 parent 8c91f1c commit a2edffb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -1702,13 +1702,13 @@ void QgsPostgresProvider::uniqueValues( int index, QList<QVariant> &uniqueValues
if ( sqlWhereClause.isEmpty() )
{
sql = QString( "select distinct %1 from %2 order by %1" )
.arg( fieldExpression( fld ) )
.arg( quotedIdentifier( fld.name() ) )
.arg( mSchemaTableName );
}
else
{
sql = QString( "select distinct %1 from %2 where %3 order by %1" )
.arg( fieldExpression( fld ) )
.arg( quotedIdentifier( fld.name() ) )
.arg( mSchemaTableName )
.arg( sqlWhereClause );
}
Expand Down Expand Up @@ -1777,7 +1777,7 @@ void QgsPostgresProvider::enumValues( int index, QStringList& enumList )
bool QgsPostgresProvider::parseEnumRange( QStringList& enumValues, const QString& attributeName ) const
{
enumValues.clear();
QString enumRangeSql = QString( "SELECT enum_range(%1) from %2 limit1" ).arg( quotedIdentifier( attributeName ) ).arg( mSchemaTableName );
QString enumRangeSql = QString( "SELECT enum_range(%1) from %2 limit 1" ).arg( quotedIdentifier( attributeName ) ).arg( mSchemaTableName );
Result enumRangeRes = connectionRO->PQexec( enumRangeSql );
if ( PQresultStatus( enumRangeRes ) == PGRES_TUPLES_OK && PQntuples( enumRangeRes ) > 0 )
{
Expand Down

0 comments on commit a2edffb

Please sign in to comment.