Skip to content
Permalink
Browse files

postgres provider: also apply filterWhereClause to feature iterators (f…

…ixes #12499 & #12500)

(cherry picked from commit 9757224)
  • Loading branch information
jef-n committed Apr 4, 2015
1 parent 8889559 commit fe3dc4cfe134adfcae9332a51a1224e54d92c1a8
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/providers/postgres/qgspostgresfeatureiterator.cpp
@@ -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 )
@@ -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();

0 comments on commit fe3dc4c

Please sign in to comment.
You can’t perform that action at this time.