Filter in Mapserver 4.10.0

Steve Lime Steve.Lime at DNR.STATE.MN.US
Tue Oct 24 01:01:31 EDT 2006


Ok, found and fixed the problem. It wasn't an issue with the lexer changes Paul refers to
rather an issue with some cleanup done in loadExpressionString in mapfile.c. I made a 
mistake and let the lexer check for simple expression strings when in reality that's should
be the default case if an expression is not a regex, logical or case insensitive. 

I have fixed in both 4.10 and 5.0 if anyone would care to confirm...

Steve

>>> Steve Lime <Steve.Lime at DNR.STATE.MN.US> 10/23/06 12:33 PM >>>
Will look into it...

Steve

>>> Paul Ramsey <pramsey at REFRACTIONS.NET> 10/19/2006 2:59:10 PM >>>
I assume this traces back to this commit:
----------------------------
revision 1.101
date: 2006/08/15 06:18:49;  author: sdlime;  state: Exp;  lines: +5 -34
Simplified quoted string rules in maplexer.l, just or'd together the  
single and
double qoute regular expressions. Updated include detection to  
support single
quotes as well.


On 19-Oct-06, at 12:21 PM, Andreas Albarello wrote:

> Sture Dingsøyr wrote:
>> The code below fails:
>> $poLayer = $mapObject->getLayerByName($layerId[$i]);
>> $poLayer->set("status", 1);			
>> $poLayer->setFilter("navn = 'Fjaler'");
>> I get this error message:
>> DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection 
>> (force_2d(the_geom)),'NDR'),gid::text from (SELECT * FROM  
>> n2000ko_f) AS n2000ko_f WHERE (navn = ) and (the_geom && setSRID 
>> ( 'BOX3D(-647132 6410334.17468806,1689132  
>> 7988665.82531194)'::BOX3D,32633) )
>
> Sture,
>
> I've experienced exactly the same problem with Mapserver 4.10.0.  
> Don't know if this should be considered a bug, but it is a  
> backwards compatibility issue with existing mapscript applications  
> at least. I believe this behavior has been caused by some recent  
> changes to the mapfile lexer.
>
> There's however a workaround for this. The following should do the  
> trick:
>
> $poLayer->setFilter("\"navn = 'Fjaler'\"");
>
> Best regards,
> -- 
> --------------------------------------------------------------------
> Andreas Albarello
> Analysis & SW Development
>
> Territorium Online srl/GmbH
> Via Buozzi/Buozzistraße 12 - I 39100 Bolzano/Bozen
> email: andreas.albarello at territoriumonline.com 
> web:   www.territoriumonline.com 
> --------------------------------------------------------------------



More information about the mapserver-dev mailing list