Skip to content

Commit

Permalink
[WFS provider] Fix setSubsetString() to accept SELECT followed by new…
Browse files Browse the repository at this point in the history
…line or tabulation
  • Loading branch information
rouault committed Jun 7, 2016
1 parent 5c3aa51 commit 496c3f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/wfs/qgswfsprovider.cpp
Expand Up @@ -655,6 +655,7 @@ QString QgsWFSProvider::subsetString()

bool QgsWFSProvider::setSubsetString( const QString& theSQL, bool updateFeatureCount )
{
QgsDebugMsg( QString( "theSql = '%1'" ).arg( theSQL ) );
mSubsetString = theSQL;
mCacheMinMaxDirty = true;

Expand All @@ -663,7 +664,10 @@ bool QgsWFSProvider::setSubsetString( const QString& theSQL, bool updateFeatureC
mShared->mLayerPropertiesList.clear();
mShared->mMapFieldNameToSrcLayerNameFieldName.clear();
mShared->mDistinctSelect = false;
if ( theSQL.startsWith( "SELECT ", Qt::CaseInsensitive ) )
if ( theSQL.startsWith( "SELECT ", Qt::CaseInsensitive ) ||
theSQL.startsWith( "SELECT\t", Qt::CaseInsensitive ) ||
theSQL.startsWith( "SELECT\r", Qt::CaseInsensitive ) ||
theSQL.startsWith( "SELECT\n", Qt::CaseInsensitive ) )
{
QString errorMsg, warningMsg;
if ( !processSQL( theSQL, errorMsg, warningMsg ) )
Expand Down

0 comments on commit 496c3f0

Please sign in to comment.