Skip to content
Permalink
Browse files

also fix QgsPostgresProvider::uniqueValues() and ::parseEnumRange()

git-svn-id: http://svn.osgeo.org/qgis/trunk@11907 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Nov 3, 2009
1 parent 8c91f1c commit a2edffba3a4d801968482ddba9aa1f408054c337
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/providers/postgres/qgspostgresprovider.cpp
@@ -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 );
}
@@ -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 )
{

0 comments on commit a2edffb

Please sign in to comment.
You can’t perform that action at this time.