FIX: Regression: AV When xp_findnextmsg Is Invoked Against an Empty Inbox (305576)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions) SP1
This article was previously published under Q305576
BUG #: 354951 (SHILOH_BUGS)
SYMPTOMS
You may see a handled access violation (AV) in SQL Server 2000 under the following conditions:
- SQL Server 2000 uses SQL Mail of Service Pack 1 (version 8.00.384 of Sqlmap70.dll).
- The xp_findnextmsg extended stored procedure is invoked without the output parameter @msg_id.
- The Inbox of the MAPI profile used by SQL Mail is empty.
A client will receive an error message that resembles the following:
ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
Additional details about this access violation are logged into the errorlog of the SQL Server instance in the \LOG subdirectory. NOTE: This is a regression in Service Pack 1 for SQL Server 2000 (build 384). This works correctly in the RTM version of SQL Server 2000 (build 194).
CAUSE
Due to other changes in Service Pack 1, xp_findnextmsg does not handle an invocation without parameters correctly.
RESOLUTIONTo resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the
Microsoft Knowledge Base:
290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack
HotfixNOTE: The following hotfix was created prior to Microsoft SQL Server 2000 Service Pack 2.
The English version of this fix should have the following file attributes or later:
Date Time Version Size File name Platform
----------------------------------------------------------------
04-Aug-2001 12:19 8.00.427 172,600 Sqlmap70.dll Intel
NOTE: Due to file dependencies, the most recent hotfix or feature that contains the above files may also contain additional files. WORKAROUND
One possible workaround is to invoke the extended stored procedure with the output parameter @msg_id and then test @msg_id against NULL. The following code demonstrates this workaround:
DECLARE @msg varchar(255)
EXEC xp_findnextmsg @msg_id = @msg OUTPUT
if @msg is null
print 'No message!'
else
print @msg
STATUS
Microsoft has confirmed this to be a problem in SQL Server 2000 Service Pack 1.
This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.
Modification Type: | Major | Last Reviewed: | 9/4/2002 |
---|
Keywords: | kbbug kbSQLServ2000preSP2Fix kbSQLServ2000SP2Fix KB305576 |
---|
|