[Fdo-trac] [fdo-trac] #1016: Query with subset of properties loses types in its geometry property
FDO
trac_fdo at osgeo.org
Mon Oct 19 14:09:00 PDT 2026
#1016: Query with subset of properties loses types in its geometry property
-------------------------------+----------------------
Reporter: jng | Owner: jng
Type: defect | Status: closed
Priority: major | Milestone: 4.2.0
Component: SQLServer Spatial | Version:
Severity: 3 | Resolution: fixed
Keywords: | External ID:
-------------------------------+----------------------
Changes (by jng):
* resolution: => fixed
* status: assigned => closed
Comment:
In [changeset:"8415" 8415]:
{{{#!CommitTicketReference repository="" revision="8415"
SQL Server Spatial: keep the geometry types on a select with an explicit
property list
FdoRdbmsSimpleFeatureReader::FilterClassDefinition() builds the filtered
class
definition that FdoIFeatureReader::GetClassDefinition() returns when a
select names
an explicit property list. Both copies of the step that patches the cloned
geometry
property from the class's own property called
gprop->SetSpecificGeometryTypes(geomProperty->GetSpecificGeometryTypes(length),
length);
GetSpecificGeometryTypes(FdoInt32&) writes the count through its reference
argument,
and the order in which a function's arguments are evaluated is
unspecified. This
Release build evaluates `length` before the call, so the setter ran with a
count of
zero, and SetSpecificGeometryTypes() with an empty list clears both masks
it derives:
the base geometry types (point/curve/surface) and the specific geometry
type list.
A select with an explicit property list therefore returned a class
definition that
reported no geometry types at all, while DescribeSchema and SELECT *
reported the
correct ones, and the serialized class definition carried
fdo:geometricTypes="" fdo:geometryTypes=""
The array and the count are now obtained before the setter is called, so
the masks of
the source geometry property are preserved.
MapGuide builds the schema of a SELECTFEATURES response from the class
definition its
reader returns, so a request that names PROPERTIES produced an empty
fdo:geometricTypes/fdo:geometryTypes for a SQL Server Spatial feature
source, while
DESCRIBEFEATURESCHEMA produced the correct ones.
Provider:
* FdoRdbmsSimpleFeatureReader::FilterClassDefinition(): both geometry-
property patches
(the explicit property list, and the extra-property loop that follows
it) take the
specific geometry types into a local before calling
SetSpecificGeometryTypes().
Tests:
* SqlServerFdoSelectTest::TestExplicitPropertyListGeometryTypes (fixture
FdoSelectTest)
creates its own datastore with a table and a view, as the reported case
selects from
a view. It records the geometry types DescribeSchema reports for the
property as the
reference, then asserts that SELECT * and SELECT with an explicit
property list both
match them, and that the class definition serialized the way MapGuide
serializes it
carries non-empty fdo:geometricTypes and fdo:geometryTypes.
Verified with the SQL Server Spatial FdoSelectTest fixture:
* Release: fails before the change (geometricTypes=0, geometryTypes=0, and
an empty
fdo:geometricTypes in the class definition XML), OK (25 tests) after it.
The other 24
tests in the fixture are unchanged.
* Debug: OK (25 tests) both before and after, because this configuration
happens to
evaluate the arguments left to right, so the defect reproduces only in
an optimised
build; the regression test has to be run in Release.
Fixes #1016
}}}
--
Ticket URL: <https://trac.osgeo.org/fdo/ticket/1016#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list