Skip to content
Permalink
Browse files

Merge pull request #2416 from elpaso/bugfix-13747

Fixes #13747
  • Loading branch information
elpaso committed Nov 3, 2015
2 parents 37e9443 + 7a789d3 commit 60c591d3a571d00eb46a3e7a573f7af1544bb5f3
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 60c591d

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