GeoTools
  1. GeoTools
  2. GEOT-1069

JDBC1DataStore fails to provide a feature reader when query requires less attributes than those used in the filter

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2, 2.3.M0, 2.4-M0
    • Fix Version/s: 2.2.3, 2.3.1, 2.4-M0
    • Component/s: jdbc
    • Labels:
      None

      Description

      A query like this:

      <?xml version="1.0" encoding="UTF-8"?>
      <wfs:GetFeature service="WFS" version="1.0.0"
      xmlns:gml="http://www.opengis.net/gml"
      xmlns:ogc="http://www.opengis.net/ogc"
      xmlns:wfs="http://www.opengis.net/wfs"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <wfs:Query typeName="topp:world">
      <ogc:PropertyName>the_geom</ogc:PropertyName>
      <ogc:Filter>
      <ogc:PropertyIsEqualTo>
      <ogc:PropertyName>name</ogc:PropertyName>
      <ogc:Literal>United States</ogc:Literal>
      </ogc:PropertyIsEqualTo>
      </ogc:Filter>
      </wfs:Query>
      </wfs:GetFeature>

      makes JDBC1DataStore throw the following exception:

      Caused by: java.lang.IllegalArgumentException: FeatureReader allready produces contents with the correct schema
      at org.geotools.data.ReTypeFeatureReader.typeAttributes(ReTypeFeatureReader.java:88)
      at org.geotools.data.ReTypeFeatureReader.<init>(ReTypeFeatureReader.java:68)
      at org.geotools.data.jdbc.JDBC1DataStore.getFeatureReader(JDBC1DataStore.java:699)
      at org.geotools.data.jdbc.JDBCFeatureCollection.reader(JDBCFeatureCollection.java:78)

      because the code tries to re-type a feature reader that already provide the requested attributes.
      This happens only if some of the properties used in the filter are not among the query requested properties (which happens quite likely when the query has been setup by the streaming renderer)

        Activity

        Hide
        Andrea Aime added a comment -
        Fixed on 2.2.x, 2.3.x, and trunk.
        Show
        Andrea Aime added a comment - Fixed on 2.2.x, 2.3.x, and trunk.
        Hide
        Andrea Aime added a comment -
        Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update
        Show
        Andrea Aime added a comment - Mass closing all issues that have been in "resolved" state for 2 months or more without any feedback or update

          People

          • Assignee:
            Andrea Aime
            Reporter:
            Andrea Aime
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: