Issue Details (XML | Word | Printable)

Key: GEOT-1573
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Justin Deoliveira
Reporter: Gertjan van Oosten
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
GeoTools

Bug with single quote in feature fields

Created: 09/Nov/07 08:42 AM   Updated: 21/Oct/08 11:18 AM
Component/s: data postgis
Affects Version/s: 2.3.5, 2.4-RC0, 2.5-M0
Fix Version/s: 2.5.2

Environment: GeoServer 1.5.4a


 Description  « Hide
When modifying a feature element (text field) with a single quote in it, the following error is logged:

08-Nov-2007 09:05:11 org.geotools.data.postgis.PostgisFeatureStore modifyFeatures
WARNING: Some sort of database connection error: ERROR: syntax error at or near "t"

The WFS-T request is:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.0.0">
<wfs:Update typeName="west:features">
<ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
<ogc:FeatureId fid="features.588" />
</ogc:Filter>
<wfs:Property>
<wfs:Name>west:name</wfs:Name>
<wfs:Value>test</wfs:Value>
</wfs:Property>
<wfs:Property>
<wfs:Name>west:geoLocation</wfs:Name>
<wfs:Value>
<gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
<gml:coordinates decimal="." cs="," ts="">1.5,55.2625</gml:coordinates>
</gml:Point>
</wfs:Value>
</wfs:Property>
<wfs:Property>
<wfs:Name>west:text</wfs:Name>
<wfs:Value>don't panic</wfs:Value>
</wfs:Property>
</wfs:Update>
</wfs:Transaction>

The response is:

<wfs:WFS_TransactionResponse version="1.0.0" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://localhost:8080/geoserver/schemas/wfs/1.0.0/WFS-transaction.xsd"> <wfs:TransactionResult> <wfs:Status> <wfs:FAILED/> </wfs:Status> <wfs:Message>Some sort of database connection error: ERROR: syntax error at or near "t"</wfs:Message>
</wfs:TransactionResult></wfs:WFS_TransactionResponse>

The feature definition in PostGIS is:

Table "public.features"
Column | Type | Modifiers
----------------------------------------------------------------------------------------------------------------
oid | integer | not null default nextval('features_oid_seq'::regclass)
name | character varying |
geoLocation | geometry |
text | character varying |
Indexes:
"features_pkey" PRIMARY KEY, btree (oid)
Check constraints:
"enforce_dims_geoLocation" CHECK (ndims("geoLocation") = 2)
"enforce_geotype_geoLocation" CHECK (geometrytype("geoLocation") = 'POINT'::text OR "geoLocation" IS NULL)
"enforce_srid_geoLocation" CHECK (srid("geoLocation") = 4326)



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.