Ticket #2720 (closed defect: fixed)
Filter encoding: simple filters using propertyislike not applied properly
|Reported by:||assefa||Owned by:||assefa|
This was reported by Bart,
"I am tracking down why a simple PropertyIsLike? filter is not being sent to the database.
The reason is that in FLTValidForPropertyIsLikeFilter there is a check on the psLeftNode and psRightNode being null. Ofcourse this is not the case, since the leftNode contains the propertyname and the rightnode contains the value. So the function returns false.
if (psFilterNode->psLeftNode == NULL && psFilterNode->psRightNode == NULL)
This code was not in 5.0.0, do you know why this was introduced?"
response from Assefa:
But obviously the function is incorrect. The previous code (5.0) should work but is limited. Here is what the intention is:
- if it is a MapServer flat file layer
- for thr filter encoding to be considered 'simple" : only one propertyislike is permitted if we want to use the filter/filteritem parameters of the layer. The code in 5.0 works for that
- if it is a DB layer: we can have unlimited number of propertyislike filters since the final expression is would end up being something like: (attribute_name like 'value')
Revering back to the 5.0 code would be a start but I need to check for the layer type to make sure that both cases described are supported properly.