Invalid FID filte results in invalid query, should result in an emtpy feature collection instead
------------------------------------------------------------------------------------------------
Key: GEOS-2039
URL: http://jira.codehaus.org/browse/GEOS-2039
Project: GeoServer
Issue Type: Bug
Components: WFS
Affects Versions: 1.7.0-beta1, 1.6.4
Reporter: Andrea Aime
Assignee: Andrea Aime
Fix For: 1.6.5, 1.7.0-beta2
Trying to use a FIDFilter whose structure does not conform to one expected by the FIDMapper in use results in invalid queries, such as:
{code:xml}
<?xml version='1.0' encoding='utf-8' ?>
<wfs:GetFeature xmlns:gml="http://www.opengis.net/gml"
outputFormat="GML2" service="WFS"
xmlns:ogc="http://www.opengis.net/ogc" maxFeatures="1" xmlns=""
xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0"> <wfs:Query
typeName="gisnet3:geonote_point" xmlns:gisnet3="http://gisnet3">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:FeatureId fid="geonote_point.nfm--49e4e129_11b0c9f16f7_-7f5b"></ogc:FeatureId>
</ogc:Filter>
</wfs:Query>
</wfs:GetFeature>
{code:xml}
results in:
{code}
Could not aquire feature:org.geotools.data.DataSourceException: Error
Performing SQL query: SELECT "id", "title", "decription", "type",
"links", "image_links", "video_links",
encode(asBinary(force_2d("the_point"),'XDR'),'base64') FROM
"public"."geonote_point" WHERE () LIMIT 1
Error Performing SQL query: SELECT "id", "title", "decription",
"type", "links", "image_links", "video_links",
encode(asBinary(force_2d("the_point"),'XDR'),'base64') FROM
"public"."geonote_point" WHERE () LIMIT 1
ERREUR: erreur de syntaxe sur ou près de « ) »
{code}
This is a limitation in the sql encoders design. The FIDMapper can throw an exception when going back from the FID to the attribute values, the sql encoder should just remove the featureid from the lot and if the fid filter becomes empty, replace it with a Filter.EXCLUDE instead.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira