Skip to content

Commit

Permalink
Disable OGR expression compilation for certain OGR drivers
Browse files Browse the repository at this point in the history
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 17, 2015
1 parent 3d947e8 commit f7ed42b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/providers/ogr/qgsogrexpressioncompiler.cpp
Expand Up @@ -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
Expand Down

0 comments on commit f7ed42b

Please sign in to comment.