Skip to content

Commit

Permalink
apply #3242
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@14748 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 23, 2010
1 parent 2a0290f commit ff165c3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3138,19 +3138,20 @@ bool QgsPostgresProvider::getGeometryDetails()
"from " ).arg( quotedIdentifier( geometryColumn ) );
if ( mUseEstimatedMetadata )
{
sql += QString( "(select %1 from %2 where %1 is not null limit %3) as t" )
sql += QString( "(select %1 from %2 where %1 is not null" )
.arg( quotedIdentifier( geometryColumn ) )
.arg( mQuery )
.arg( sGeomTypeSelectLimit );
.arg( mQuery );
if ( !sqlWhereClause.isEmpty() )
sql += " and " + sqlWhereClause;
sql += QString( " limit %1 ) as t" ).arg( sGeomTypeSelectLimit );
}
else
{
sql += mQuery;
if ( !sqlWhereClause.isEmpty() )
sql += " where " + sqlWhereClause;
}

if ( !sqlWhereClause.isEmpty() )
sql += " where " + sqlWhereClause;

result = connectionRO->PQexec( sql );

if ( PQntuples( result ) == 1 )
Expand Down

0 comments on commit ff165c3

Please sign in to comment.