Skip to content

Commit 496c3f0

Browse files
committed
[WFS provider] Fix setSubsetString() to accept SELECT followed by newline or tabulation
1 parent 5c3aa51 commit 496c3f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/providers/wfs/qgswfsprovider.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ QString QgsWFSProvider::subsetString()
655655

656656
bool QgsWFSProvider::setSubsetString( const QString& theSQL, bool updateFeatureCount )
657657
{
658+
QgsDebugMsg( QString( "theSql = '%1'" ).arg( theSQL ) );
658659
mSubsetString = theSQL;
659660
mCacheMinMaxDirty = true;
660661

@@ -663,7 +664,10 @@ bool QgsWFSProvider::setSubsetString( const QString& theSQL, bool updateFeatureC
663664
mShared->mLayerPropertiesList.clear();
664665
mShared->mMapFieldNameToSrcLayerNameFieldName.clear();
665666
mShared->mDistinctSelect = false;
666-
if ( theSQL.startsWith( "SELECT ", Qt::CaseInsensitive ) )
667+
if ( theSQL.startsWith( "SELECT ", Qt::CaseInsensitive ) ||
668+
theSQL.startsWith( "SELECT\t", Qt::CaseInsensitive ) ||
669+
theSQL.startsWith( "SELECT\r", Qt::CaseInsensitive ) ||
670+
theSQL.startsWith( "SELECT\n", Qt::CaseInsensitive ) )
667671
{
668672
QString errorMsg, warningMsg;
669673
if ( !processSQL( theSQL, errorMsg, warningMsg ) )

0 commit comments

Comments
 (0)