Skip to content
Permalink
Browse files

Fixes #13747

  • Loading branch information
nyalldawson committed Nov 18, 2015
1 parent 15f59ae commit 49c243c68256e12613867b2782431e77346b13d6
Showing with 21 additions and 6 deletions.
  1. +21 −6 src/providers/spatialite/qgsspatialitefeatureiterator.cpp
@@ -34,31 +34,46 @@ QgsSpatiaLiteFeatureIterator::QgsSpatiaLiteFeatureIterator( QgsSpatiaLiteFeature
mHasPrimaryKey = !mSource->mPrimaryKey.isEmpty();
mRowNumber = 0;

QStringList whereClauses;
QString whereClause;
if ( !request.filterRect().isNull() && !mSource->mGeometryColumn.isNull() )
{
// some kind of MBR spatial filtering is required
whereClause += whereClauseRect();
whereClause = whereClauseRect();
if ( ! whereClause.isEmpty() )
{
whereClauses.append( whereClause );
}
}

if ( request.filterType() == QgsFeatureRequest::FilterFid )
{
whereClause += whereClauseFid();
whereClause = whereClauseFid();
if ( ! whereClause.isEmpty() )
{
whereClauses.append( whereClause );
}
}
else if ( request.filterType() == QgsFeatureRequest::FilterFids )
{
whereClause += whereClauseFids();
whereClause = whereClauseFids();
if ( ! whereClause.isEmpty() )
{
whereClauses.append( whereClause );
}
}

if ( !mSource->mSubsetString.isEmpty() )
{
if ( !whereClause.isEmpty() )
whereClause = "( " + mSource->mSubsetString + ')';
if ( ! whereClause.isEmpty() )
{
whereClause += " AND ";
whereClauses.append( whereClause );
}
whereClause += "( " + mSource->mSubsetString + ")";
}

whereClause = whereClauses.join( " AND " );

// preparing the SQL statement
if ( !prepareStatement( whereClause ) )
{

0 comments on commit 49c243c

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