[Fdo-trac] [fdo-trac] #864: BUG in SQL Server Spatial FDO provider when using filter

FDO trac_fdo at osgeo.org
Wed Apr 24 07:48:37 PDT 2013


#864: BUG in SQL Server Spatial FDO provider when using filter
---------------------------------+------------------------------------------
   Reporter:  sreckol            |       Owner:  danstoica            
       Type:  defect             |      Status:  new                  
   Priority:  critical           |   Milestone:  3.8.0                
  Component:  SQLServer Spatial  |     Version:  3.8.0                
   Severity:  3                  |    Keywords:  MSSQL, PostGis Filter
External_id:                     |  
---------------------------------+------------------------------------------
 There is huge BUG in SQL Server Spatial FDO provider (and also in PostGIS
 provider) when using filter to Query Data.

 When filter is present FDO creates SQL query, where filter text should be
 in brackets (especially when using OR in filter text), but it is not!?

 This affect performance a lot when using large datatables and want to get
 subdataset.
 It affect MGOS a lot, which become unusable when filter is used on large
 tables.

 Example:
 Filter: IMPORT_OB_ID=184 OR IMPORT_OB_ID=189

 FDO generates SQL Query like this:
 SELECT  A.IMPORT_OB_ID,A.SPATIAL_GEOMETRY FROM dbo.KAT_PD_GRAF AS A
 WHERE A.IMPORT_OB_ID=184 OR A.IMPORT_OB_ID=189
 AND A.[SPATIAL_GEOMETRY].STIntersects(convert(geometry,
 @P1).STEnvelope())=1

 Filter text should be in brackets:
 SELECT  A.IMPORT_OB_ID,A.SPATIAL_GEOMETRY FROM dbo.KAT_PD_GRAF AS A
 WHERE '''('''A.IMPORT_OB_ID=184 OR A.IMPORT_OB_ID=189''')'''
 AND A.[SPATIAL_GEOMETRY].STIntersects(convert(geometry,
 @P1).STEnvelope())=1


 Tested with MGOS 2.4 (FDO 3.7) and MGOS 2.5 (FDO 3.8).

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/864>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list