Skip to content

Commit

Permalink
postgres provider: also apply filterWhereClause to feature iterators (f…
Browse files Browse the repository at this point in the history
…ixes #12499 & #12500)

(cherry picked from commit 9757224)
  • Loading branch information
jef-n committed Apr 4, 2015
1 parent 8889559 commit fe3dc4c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/postgres/qgspostgresfeatureiterator.cpp
Original file line number Diff line number Diff line change
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 fe3dc4c

Please sign in to comment.