Skip to content

Commit

Permalink
Fix regression of previous commit in ogr_multi_defer.png and ogr_attr…
Browse files Browse the repository at this point in the history
…filter.png (#4974, #4999)
  • Loading branch information
rouault committed Sep 20, 2014
1 parent 6902603 commit 6a4d00e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mapogr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,9 @@ static char* msOGRTranslateMsExpressionToOGRSQL(layerObj* layer,

if (layer->debug >= MS_DEBUGLEVEL_VVV)
msDebug("msOGRTranslateMsExpressionToOGRSQL: filter can be evaluated completely on OGR side\n");
msFree( layer->filter.string );
layer->filter.string = NULL;

msFree( layer->filter.native_string );
layer->filter.native_string = msStrdup(msSQLExpression);
}

if( sBBOXValid )
Expand Down Expand Up @@ -1555,6 +1556,11 @@ static int msOGRFileWhichShapes(layerObj *layer, rectObj rect,
/* In case we have an odd filter combining both a OGR filter and MapServer */
/* filter, then separate things */
msOGRSplitFilter(layer, &pszOGRFilter, &pszMSFilter);
if( pszOGRFilter != NULL && pszMSFilter == NULL )
{
msFree(layer->filter.native_string);
layer->filter.native_string = msStrdup(pszOGRFilter);
}

/* Apply sortBy */
if( layer->sortBy.nProperties > 0 ) {
Expand Down

0 comments on commit 6a4d00e

Please sign in to comment.