FIX: Merge Join with Rank Operator May Produce Incorrect Results (306890)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q306890
BUG #: 355150 (SHILOH_BUGS)

SYMPTOMS

SQL Server may return incorrect results for a query if all of the following conditions are true:
  • A merge join operation is performed.
  • One of the inputs to the merge is a Rank operator.
  • The input to the Rank operator is some unordered input, such as an index scan.
  • The join column for the merge join is not the same column as the ranking column.
  • There is not a sort between the rank and the merge join.

CAUSE

The merge join requires its inputs to be sorted on the join column(s). If the rank is present in the plan, the optimizer may not build a plan such that the correct ordering of rows is guaranteed when they reach the merge join. When the rows are not sorted, the merge join will not produce correct results.

RESOLUTION

A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next SQL Server service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix should have the following file attributes or later:
   Version      File name    
   --------------------------
   8.00.439     S80439I.exe
				
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 2000.

Modification Type:MinorLast Reviewed:10/7/2005
Keywords:kbbug kbfix kbQFE KB306890