FIX: Incorrect result is returned when the STUnion() method is called between a geometry instance and a GEOMETRYCOLLECTION instance in a query in SQL Server 2008

Article translations Article translations
Article ID: 2660646 - View products that this article applies to.
Expand all | Collapse all

On This Page

Microsoft distributes Microsoft SQL Server 2008 Service Pack 3 (SP3) fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 Service Pack 3 (SP3) fix release.

SYMPTOMS

Consider the following scenario:
  • You have a geometry instance and a GEOMETRYCOLLECTION instance that contains intersecting polygons in Microsoft SQL Server 2008.
  • You create a query that calls the STUnion() method between the twoinstances.
  • You try to run the query.

In this scenario, the intersection of the GEOMETRYCOLLECTION instance's polygons is not contained in the query result that the STUnion() method returns.

CAUSE

This issue occurs because of a code defect in the STUnion() method.

RESOLUTION

Cumulative update information

Cumulative update package 3 for SQL Server 2008 SP3

The fix for this issue was first released in Cumulative Update 3. For more information about how to obtain this cumulative update package for SQL Server 2008 Service Pack 3, click the following article number to view the article in the Microsoft Knowledge Base:
2648098 Cumulative update package 3 for SQL Server 2008 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 Service Pack 3 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2629969 SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 3 was released


MORE INFORMATION

To reproduce this issue, follow these steps:
  1. Run the following query in Microsoft SQL Server Management Studio:
    DECLARE @p1 geometry = 'GEOMETRYCOLLECTION (POLYGON ((0 0, 1 1, 1 0, 0 0)), POLYGON ((0.5 0, 1.5 1, 1.5 0, 0.5 0)))';
    DECLARE @p2 geometry = 'POINT(0 1)';
    SELECT @p1.STUnion(@p2)
  2. Click the Spatial results tab of the result that is returned by the query.
If the intersection of two triangles from the first parameter is missing, then you have reproduced the issue successfully.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Properties

Article ID: 2660646 - Last Review: January 30, 2012 - Revision: 2.0
APPLIES TO
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 R2 Developer
  • Microsoft SQL Server 2008 R2 Enterprise
Keywords: 
kbqfe kbfix kbexpertiseadvanced kbsurveynew KB2660646

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com