Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
apply #3242
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14748 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 23, 2010
1 parent 0e3cc72 commit 874eb33
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/providers/postgres/qgspostgresprovider.cpp
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 874eb33

Please sign in to comment.