BUG in SQL Server Spatial FDO provider when using filter to Query Data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

BUG in SQL Server Spatial FDO provider when using filter to Query Data

Srecko Lipovsek

I think I found huge BUG in SQL Server Spatial FDO driver (maybe in Generic Rdbms) when using filter in MapGuide layer (the same when using theme on layer, where filters are also present).

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!?

Example:
Filter in MG layer: 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

Same is also in PostGis FDO driver so I supose there is defect in Generic Rdbms ...

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

Could please somebody check.