Filter in Mapserver 4.10.0

Sture Dingsøyr candalt at ONLINE.NO
Thu Oct 19 14:49:42 EDT 2006


Hi there

Have been using setFilter in Mapscript for a while (with mapserver 4.8.3). Have now upgraded to Mapserver 4.10.0 and now the setFilter function seems not to work when setting an SQL Filter..

Have tested setting the SQL Where clause directly in the Mapfile...and there it works, but when i want to apply the same SQL WHere clause via Mapscript and setFilter...the SQL Where clause gets "cut" after the single quote. E.g.

The SQL Where clause "navn = 'Fjaler'" works fine when used directly in the mapfile.

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) )

You can see that the Where clause is "cut" at the single quote...

If I apply a filter on a "number" colum the setFilter function works fine...e.g. "gid = 12"

Is this a bug in Mapscript with Mapserver 4.10.0?

Regard
Sture


More information about the mapserver-dev mailing list