Skip to content

Commit fe3dc4c

Browse files
committedApr 4, 2015
postgres provider: also apply filterWhereClause to feature iterators (fixes #12499 & #12500)
(cherry picked from commit 9757224)
1 parent 8889559 commit fe3dc4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed
 

‎src/providers/postgres/qgspostgresfeatureiterator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ void QgsPostgresFeatureIterator::getFeatureAttribute( int idx, QgsPostgresResult
569569
QgsPostgresFeatureSource::QgsPostgresFeatureSource( const QgsPostgresProvider* p )
570570
: mConnInfo( p->mUri.connectionInfo() )
571571
, mGeometryColumn( p->mGeometryColumn )
572-
, mSqlWhereClause( p->mSqlWhereClause )
573572
, mFields( p->mAttributeFields )
574573
, mSpatialColType( p->mSpatialColType )
575574
, mRequestedSrid( p->mRequestedSrid )
@@ -582,6 +581,11 @@ QgsPostgresFeatureSource::QgsPostgresFeatureSource( const QgsPostgresProvider* p
582581
, mQuery( p->mQuery )
583582
, mShared( p->mShared )
584583
{
584+
mSqlWhereClause = p->filterWhereClause();
585+
586+
if ( mSqlWhereClause.startsWith( " WHERE " ) )
587+
mSqlWhereClause = mSqlWhereClause.mid( 7 );
588+
585589
if ( p->mTransaction )
586590
{
587591
mTransactionConnection = p->mTransaction->connection();

0 commit comments

Comments
 (0)
Please sign in to comment.