FIX : Use of a Fast Forward Cursor with a UNION Operator and a Remote Table May Cause Access Violation (312294)



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q312294
BUG #: 356004 (SHILOH_BUGS)

SYMPTOMS

If you use a FAST_FORWARD cursor that is built on a query that contains a UNION operator and a remote table, an exception Access Violation (AV) may occur.

You will see an error message in Query Analyzer similar to:
ODBC: Msg 0, Level 19, State 1 SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process. Connection Broken
NOTE: Other data access tools return similar error messages. This call stack is in the SQL Server 2000 error log if you do not have any service packs installed:
007E1091 Module(sqlservr+003E1091) CCvtTree::PdrgcidBldColumns
007D8169 Module(sqlservr+003D8169) CCvtTree::PexprBuildQuery
007D775C Module(sqlservr+003D775C) CCvtTree::PexprFromTree
005642A9 Module(sqlservr+001642A9) CCvtTree::PqryFromTree
00564019 Module(sqlservr+00164019) BuildQueryFromTree
005D285A Module(sqlservr+001D285A) CFetchKeyset::CompileQuery
005D3050 Module(sqlservr+001D3050) CFetchKeyset::CompileSetFetchExp
005D32DA Module(sqlservr+001D32DA) CFetchKeyset::CompileKeysetExprs
005D3428 Module(sqlservr+001D3428) CFetchKeyset::Compile
005CF95C Module(sqlservr+001CF95C) CFetchComponent::smInitializeFetchComponent
005B786C Module(sqlservr+001B786C) CCursorDeclareStmt::Init
005BAA16 Module(sqlservr+001BAA16) CompileCursor
0060E7EC Module(sqlservr+0020E7EC) CCompPlan::FCompileStep
				

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft SQL Server 2000 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:
   Date         Time       Version        Size               File name
   ---------------------------------------------------------------------

   08/11/2001   06:04 AM   8.00.0465.01   7,409,748 bytes   Sqlservr.exe
				
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.


WORKAROUND

To work around this problem, use a STATIC cursor instead of a FAST_FORWARD cursor.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Several similar problems are also fixed, including cursors built on queries that contain DISTINCT, GROUP BY, HAVING, or aggregates (besides UNION) in conjunction with remote tables or in conjunction with projections of large objects (LOBs) columns (such as text, ntext and image).

REFERENCES

SQL Server 2000 Books Online: topics; "DECLARE CURSOR"; "Declaring Cursors"

Modification Type:MinorLast Reviewed:10/12/2005
Keywords:kbHotfixServer kbQFE kbbug kbfix kbQFE kbSQLServ2000preSP2Fix KB312294