Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
postgres provider: also apply filterWhereClause to feature iterators (f…
…ixes #12499 & #12500)
  • Loading branch information
jef-n committed Apr 2, 2015
1 parent e16ebfa commit 9757224
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/postgres/qgspostgresfeatureiterator.cpp
Expand Up @@ -569,7 +569,6 @@ void QgsPostgresFeatureIterator::getFeatureAttribute( int idx, QgsPostgresResult
QgsPostgresFeatureSource::QgsPostgresFeatureSource( const QgsPostgresProvider* p )
: mConnInfo( p->mUri.connectionInfo() )
, mGeometryColumn( p->mGeometryColumn )
, mSqlWhereClause( p->mSqlWhereClause )
, mFields( p->mAttributeFields )
, mSpatialColType( p->mSpatialColType )
, mRequestedSrid( p->mRequestedSrid )
Expand All @@ -582,6 +581,11 @@ QgsPostgresFeatureSource::QgsPostgresFeatureSource( const QgsPostgresProvider* p
, mQuery( p->mQuery )
, mShared( p->mShared )
{
mSqlWhereClause = p->filterWhereClause();

if ( mSqlWhereClause.startsWith( " WHERE " ) )
mSqlWhereClause = mSqlWhereClause.mid( 7 );

if ( p->mTransaction )
{
mTransactionConnection = p->mTransaction->connection();
Expand Down

0 comments on commit 9757224

Please sign in to comment.