Opened 12 years ago

Closed 12 years ago

#862 closed defect (fixed)

Do not query table-valued inline functions in SpatialContextReader

Reported by: gBecker Owned by: jng
Priority: major Milestone: 3.8.0
Component: SQLServer Spatial Version: 3.7.0
Severity: 3 Keywords:
Cc: External ID:

Description

If you have table-valued functions in your SQL Server Database that returns a table with spatial columns then you get an error when trying to determine the extent of the data. The following error is listed in MapGuide error.log:

Error: An exception occurred in FDO component.

Error occurred in Feature Source (Session:05eea926-80b9-11e2-8000-002264a7285f_en_MTI3LjAuMC4x0AFC0AFB0AFA//3c1658ff-82a7-44a9-9005-3f262b0cb02d.FeatureSource): RDBMS: [Microsoft][SQL Server Native Client 10.0][SQL Server]Parameters were not supplied for the function 'FFM_Fes.cdc.fn_cdc_get_all_changes_dbo_fes_AlteGeometrien'.

Since table-valued functions are supposable not supported in SQL Server Provider for FDO, the solution could be to just query SQL Server objects that are not of type 'function'. I think the SQL to query the extent of the spatial data is in this file:http://trac.osgeo.org/fdo/browser/trunk/Providers/GenericRdbms/Src/SQLServerSpatial/SchemaMgr/Ph/Rd/SpatialContextReader.cpp

Changing the WHERE-clause to

 where ((f.name in ( 'geometry','geography' ) or e.object_id is not null) AND a.type <> 'if')

should solve the problem, I think.

Maybe there are other places to change!

Attachments (2)

TableValuedFunction.sql (1.9 KB ) - added by gBecker 12 years ago.
Minimal example
862.patch (1.1 KB ) - added by jng 12 years ago.

Download all attachments as: .zip

Change History (7)

by gBecker, 12 years ago

Attachment: TableValuedFunction.sql added

Minimal example

by jng, 12 years ago

Attachment: 862.patch added

comment:2 by gBecker, 12 years ago

Resolution: fixed
Status: newclosed

Everything is working now as expected! Thanks.

comment:3 by jng, 12 years ago

Resolution: fixed
Status: closedreopened

Re-opening because patch has not been reviewed/committed yet.

comment:4 by jng, 12 years ago

Owner: changed from danstoica to jng
Status: reopenednew

comment:5 by jng, 12 years ago

Resolution: fixed
Status: newclosed

Fixed trunk (r6791) and 3.8 (r6792)

Note: See TracTickets for help on using tickets.