GetFeature with filter containing an xsd:dateTime column
--------------------------------------------------------
Key: GEOS-3661
URL: http://jira.codehaus.org/browse/GEOS-3661
Project: GeoServer
Issue Type: Bug
Components: Oracle
Affects Versions: 1.7.7
Environment: Linux - Tomcat
Reporter: Kasper Thuno
Assignee: Andrea Aime
I am currently facing a problem when trying to request data from an Oracle database and filtering on a column which is an Oracle date and defined as an xsd:dateTime in Geoserver.
This is the output from DescribeFeatureType (I have shortened and anonymized it) :
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:xxx="xxx" elementFormDefault="qualified" targetNamespace="xxx">
<xsd:import namespace="http://www.opengis.net/gml" schemaLocation="xxx/schemas/gml/2.1.2/feature.xsd"/>
<xsd:element name="xxx" substitutionGroup="gml:_Feature" type="xxx"/>
<xsd:complexType name="xxx">
<xsd:complexContent>
<xsd:extension base="gml:AbstractFeatureType">
<xsd:sequence>
...
<xsd:element maxOccurs="1" minOccurs="0" name="GYLDIG_FRA" nillable="true" type="xsd:dateTime"/>
...
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>
This is output from GetFeature (without filter - again shortened and anonymized):
<wfs:FeatureCollection xsi:schemaLocation="xxx xxx/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=xxx http://www.opengis.net/wfs http://wfs.arealinfo.dk:80/schemas/wfs/1.0.0/WFS-basic.xsd">
<gml:boundedBy>
<gml:null>unknown</gml:null>
</gml:boundedBy>
<gml:featureMember>
<xxx fid="xxx.nfm-3da584d6_12507c6672d_-4d4">
...
<xxx:GYLDIG_FRA>2006-12-31</xxx:GYLDIG_FRA>
...
</xxx>
</gml:featureMember>
</wfs:FeatureCollection>
So the obvious would be to do the following:
But that results in this:
<?xml version="1.0" ?>
<ServiceExceptionReport
version="1.2.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
error:Translator error
Translator error
Error reading Features
Could not aquire feature:org.geotools.data.DataSourceException: Error Performing SQL query: SELECT ... "GYLDIG_FRA", ... WHERE "GYLDIG_FRA" = '2009-01-26'
Error Performing SQL query: SELECT ... "GYLDIG_FRA", ... WHERE "GYLDIG_FRA" = '2009-01-26'
ORA-01861: literal does not match format string
</ServiceException></ServiceExceptionReport>
And whatever I do, Geoserver/Geotools insists on placing '' (single quotes) around the contents within <Literal>...</Literal> so using Oracle functions is not possible (which actually might be a good thing to avoid injection :-).
Doing the exact same thing from sqlplus yields a positive result, so it must be within Geoserver/Geotools that this problem resides.
SQL> select gyldig_fra from xxx where gyldig_fra = '2006-12-31';
GYLDIG_F
--------
06-12-31
06-12-31
...
Is this a bug or am I just doing something wrong???
(Note: I have also posted this on the mailing list without replies so far.)
--
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