Skip to content
Permalink
Browse files

mssql provider: fix filter type interpretation (fixes #11076)

  • Loading branch information
jef-n committed Sep 9, 2014
1 parent 071a5ec commit 7fe45db70c7e5d583703b9e022e9c666237305a5
Showing with 9 additions and 7 deletions.
  1. +9 −7 src/providers/mssql/qgsmssqlfeatureiterator.cpp
@@ -89,7 +89,7 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest& request )

bool filterAdded = false;
// set spatial filter
if ( request.filterType() & QgsFeatureRequest::FilterRect && mSource->isSpatial() )
if ( request.filterType() == QgsFeatureRequest::FilterRect && mSource->isSpatial() )
{
// polygons should be CCW for SqlGeography
QString r;
@@ -109,7 +109,7 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest& request )
}

// set fid filter
if (( request.filterType() & QgsFeatureRequest::FilterFid ) && !mSource->mFidColName.isEmpty() )
if ( request.filterType() == QgsFeatureRequest::FilterFid && !mSource->mFidColName.isEmpty() )
{
QString fidfilter = QString( " [%1] = %2" ).arg( mSource->mFidColName, QString::number( request.filterFid() ) );
// set attribute filter
@@ -131,11 +131,13 @@ void QgsMssqlFeatureIterator::BuildStatement( const QgsFeatureRequest& request )
}

QgsDebugMsg( mStatement );
// if ( fieldCount == 0 )
// {
// QgsDebugMsg( "QgsMssqlProvider::select no fields have been requested" );
// mStatement.clear();
// }
#if 0
if ( fieldCount == 0 )
{
QgsDebugMsg( "QgsMssqlProvider::select no fields have been requested" );
mStatement.clear();
}
#endif
}


0 comments on commit 7fe45db

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