Opened 15 years ago

Closed 15 years ago

#3042 closed defect (fixed)

Problem with OGC Filter FEATUREID and WFS with type ORACLESPATIAL

Reported by: msmitherdc Owned by: assefa
Priority: normal Milestone: 5.6 release
Component: WFS Server Version: 5.4
Severity: normal Keywords: oraclespatial, featureid, filter, where
Cc: dmorissette, aboudreault

Description

When querying an Oracle Spatial layer using WFS and passing a FEATUREID filter, the constructed sql query is missing parens around the collected OR predicates. It is missing 2 opening parens and the closing parens before the SDO_FILTER part and there is a quote character outside the last parens when it should be inside.

This looks to be in mapogcfilter.c

example call:

http://localhost/cgi-bin/mapserv?map=cm2_dev/cm2_watwms.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&FEATUREID=usgsgages.7759,usgsgages.7760,usgsgages.7761,usgsgages.7762,usgsgages.7792,usgsgages.7794,usgsgages.7795,usgsgages.7796,usgsgages.7797,usgsgages.7810,usgsgages.7811,usgsgages.7812&TYPENAME=usgsgages

returns

<ServiceExceptionReport version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd"> <ServiceException code="NoApplicableCode" locator="mapserv"> msWFSGetFeature: WFS server error. FLTApplyFilterToLayer() failed msOracleSpatialLayerWhichShapes(): OracleSpatial error. Error: ORA-00933: SQL command not properly ended

Query statement: SELECT objectid, PERCENTILE, SHAPE FROM METAR.USGS_REALSTX WHERE objectid = '7759') OR (objectid = '7760') OR (objectid = '7761') OR (objectid = '7762') OR (objectid = '7792') OR (objectid = '7794') OR (objectid = '7795') OR (objectid = '7796') OR (objectid = '7797') OR (objectid = '7810') OR (objectid = '7811') OR (objectid = '7812)' AND SDO_FILTER( SHAPE, MDSYS.SDO_GEOMETRY(2003, 8265, NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,3),MDSYS.SDO_ORDINATE_ARRAY(-177.47,13.43,-64.71,72.55) ),'querytype=window') = 'TRUE' . Check your data statement.

</ServiceException> </ServiceExceptionReport>

Attachments (1)

mapogcfilter.c.3042.patch (1.3 KB ) - added by assefa 15 years ago.
patch againts mapserver 5.4.x branch

Download all attachments as: .zip

Change History (7)

comment:1 by assefa, 15 years ago

Owner: changed from mapserverbugs to assefa

From what I can see using the 5.4.x branch, It was missing the enclosing brackets for the whole expressions but the first opening bracket should be there. Here is is I had on my tests:

(popplace_ = '109') OR (popplace_ = '118') OR (popplace_ = '118') OR (popplace_ = '112')

I have attached a patch (against the 5.4.x branch) here that puts the enclosing brackets. I do not have oracle installed locally to test it fully so if you are able to test it, that would be great. if not I will install oracle to do some local tests.

by assefa, 15 years ago

Attachment: mapogcfilter.c.3042.patch added

patch againts mapserver 5.4.x branch

comment:2 by dmorissette, 15 years ago

Milestone: 5.6 release

Assefa, Mike, can we get this in the 5.6 release?

comment:3 by dmorissette, 15 years ago

Cc: dmorissette aboudreault added

comment:4 by assefa, 15 years ago

The correction was made in the trunk. Is it possible to do a test on an Oracle layer and report? Thanks.

comment:5 by msmitherdc, 15 years ago

Assefa,

Changes look good. Got the expected output from wfs now.

comment:6 by assefa, 15 years ago

Resolution: fixed
Status: newclosed

Thanks for testing.

Note: See TracTickets for help on using tickets.