Opened 18 years ago

Closed 16 years ago

#1713 closed defect (fixed)

wfs escape character \ leads to error in postgis

Reported by: piebe.de.vries@… Owned by: assefa
Priority: high Milestone:
Component: WFS Server Version: unspecified
Severity: normal Keywords:
Cc: tomkralidis

Description

Using \ as an escape character in a wfs request leads to an syntax error in the
postgis database.

Solution: 
Escape the escape character in the postgis request ie change '\' in '\\'


Example of postgis error:
prepare_database(): Query error. Error executing POSTGIS DECLARE (the actual
query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d(the_geom)),'NDR'),sleutel::text from
vw_visrechten_guest WHERE (blabla like 'H2001_0080_221%' escape '\') and
(the_geom && setSRID( 'BOX3D(10000 305000,280000
619000)'::BOX3D,find_srid('','vw_layername','the_geom') ))' <br><br>

Postgresql reports the error as 'ERROR:  syntax error at or near "BOX3D" at
character 216



Example of wfs request that leads to error:
<GetFeature version="1.0.0" service="WFS"
 ...
  maxFeatures="25" outputFormat="GML2">
  <wfs:Query typeName="layername">
        <ogc:Filter>
             <ogc:PropertyIsLike wildCard="*" singleChar="?" escape="\">
<ogc:PropertyName>blabla</ogc:PropertyName>
<ogc:Literal>H2001?0080?221*</ogc:Literal>

</ogc:PropertyIsLike></ogc:Filter>
  </wfs:Query>
</GetFeature>

I am using an older version of mapserver so error might have disappeared by now,
but i have no time to check.

Change History (2)

comment:1 by assefa, 18 years ago

Cc: mapserver-bugs@… added
Owner: changed from mapserverbugs to assefa
Corrected in mapserver cvs.

Please mark it as fixed after test.

comment:2 by tomkralidis, 16 years ago

Cc: tomkralidis added
Resolution: fixed
Status: newclosed

Tested. Works as expected when @escape="\"

Note: See TracTickets for help on using tickets.