Skip to content

Commit 8f08d0d

Browse files
author
jef
committedNov 3, 2009
also fix QgsPostgresProvider::uniqueValues() and ::parseEnumRange()
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11907 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,13 +1702,13 @@ void QgsPostgresProvider::uniqueValues( int index, QList<QVariant> &uniqueValues
17021702
if ( sqlWhereClause.isEmpty() )
17031703
{
17041704
sql = QString( "select distinct %1 from %2 order by %1" )
1705-
.arg( fieldExpression( fld ) )
1705+
.arg( quotedIdentifier( fld.name() ) )
17061706
.arg( mSchemaTableName );
17071707
}
17081708
else
17091709
{
17101710
sql = QString( "select distinct %1 from %2 where %3 order by %1" )
1711-
.arg( fieldExpression( fld ) )
1711+
.arg( quotedIdentifier( fld.name() ) )
17121712
.arg( mSchemaTableName )
17131713
.arg( sqlWhereClause );
17141714
}
@@ -1777,7 +1777,7 @@ void QgsPostgresProvider::enumValues( int index, QStringList& enumList )
17771777
bool QgsPostgresProvider::parseEnumRange( QStringList& enumValues, const QString& attributeName ) const
17781778
{
17791779
enumValues.clear();
1780-
QString enumRangeSql = QString( "SELECT enum_range(%1) from %2 limit1" ).arg( quotedIdentifier( attributeName ) ).arg( mSchemaTableName );
1780+
QString enumRangeSql = QString( "SELECT enum_range(%1) from %2 limit 1" ).arg( quotedIdentifier( attributeName ) ).arg( mSchemaTableName );
17811781
Result enumRangeRes = connectionRO->PQexec( enumRangeSql );
17821782
if ( PQresultStatus( enumRangeRes ) == PGRES_TUPLES_OK && PQntuples( enumRangeRes ) > 0 )
17831783
{

0 commit comments

Comments
 (0)
Please sign in to comment.