Skip to content
Permalink
Browse files

Disable OGR expression compilation for certain OGR drivers

In some cases OGR forwards filters on to the underlying data source,
and the syntax may differ from OGR SQL. In these cases disable
expression compilation.
  • Loading branch information
nyalldawson committed Nov 16, 2015
1 parent 3d947e8 commit f7ed42b933ede4857474d93bc7ce666a41c29397
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/providers/ogr/qgsogrexpressioncompiler.cpp
@@ -29,6 +29,24 @@ QgsOgrExpressionCompiler::~QgsOgrExpressionCompiler()

QgsOgrExpressionCompiler::Result QgsOgrExpressionCompiler::compile( const QgsExpression* exp )
{
//for certain driver types, OGR forwards SQL through to the underlying provider. In these cases
//the syntax may differ from OGR SQL, so we don't support compilation for these drivers
//see http://www.gdal.org/ogr_sql.html
if ( mSource->mDriverName == "MySQL" )
return Fail;
else if ( mSource->mDriverName == "PostgreSQL" )
return Fail;
else if ( mSource->mDriverName == "OCI" )
return Fail;
else if ( mSource->mDriverName == "SQLite" )
return Fail;
else if ( mSource->mDriverName == "ODBC" )
return Fail;
else if ( mSource->mDriverName == "PGeo" )
return Fail;
else if ( mSource->mDriverName == "MSSQLSpatial" )
return Fail;

if ( exp->rootNode() )
return compile( exp->rootNode(), mResult );
else

0 comments on commit f7ed42b

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