Microsoft KB Archive/308114

= FIX: Query with Multiple Predicates and a Star Join May Cause an Access Violation =

Article ID: 308114

Article Last Modified on 9/26/2005

-

APPLIES TO


 * Microsoft SQL Server 7.0 Service Pack 2
 * Microsoft SQL Server 7.0 Service Pack 3

-



This article was previously published under Q308114



BUG #: 101965 (SQLBUG_70)



SYMPTOMS
If you run a query with more than one predicate in the WHERE clause, and the query uses a star join, the query may fail with following error message:

ODBC: Msg 0, Level 19, State 1 SqlDumpExceptionHandler: Process 8 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

The following stack dump also appears in the SQL Server error log:

Stack dump from SQL Server Service Pack 3

Short Stack Dump 0x0041183d Module(sqlservr+1183d) (CEsCompValSeg::CreateExecValSeg+c3) 0x0041174b Module(sqlservr+1174b) (CEsExec::CEsExec+10b) 0x004116f1 Module(sqlservr+116f1) (CEs::Startup+40) 0x00416a44 Module(sqlservr+16a44) (CQueryExecContext::StartupExpr+16) 0x00499e13 Module(sqlservr+99e13) (CQScanFilter::CQScanFilter+8c) 0x00499e62 Module(sqlservr+99e62) (CXteFilter::QScanGet+38) 0x0041cc33 Module(sqlservr+1cc33) (CXteProject::QScanGet+51) 0x0041596c Module(sqlservr+1596c) (CQueryScan::CQueryScan+24f) 0x004157da Module(sqlservr+157da) (CQuery::Execute+4f) 0x0041016a Module(sqlservr+1016a) (CStmtQuery::FExecuteQuery+1df) 0x0041c72a Module(sqlservr+1c72a) (CStmtSelect::XretExecute+1f8) 0x0040f487 Module(sqlservr+f487) (CMsqlExecContext::ExecuteStmts+11b) 0x0040ef35 Module(sqlservr+ef35) (CMsqlExecContext::Execute+16b)



CAUSE
The SQL Server 7.0 query optimizer does not handle this situation correctly.



RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack

NOTE: The following hotfix was created prior to Microsoft SQL Server 7.0 Service Pack 4.

The English version of this fix should have the following file attributes or later:   Date      Time       Version       Size      File name      Platform --

9/27/01  12:08 AM   2001.9.26.0   4937 KB   Sqlservr.exe   Intel NOTE: Because of file dependencies, the most recent hotfix or feature that contains the preceding files may also contain additional files.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 7.0 Service Pack 4.



MORE INFORMATION
This problem does not occur on Microsoft SQL Server 7.0 RTM or Microsoft SQL Server 7.0 Service Pack 1 (SP1).

For example, a query similar to the following may cause the AV (only when SQL Server uses a star join): SELECT A.col5 FROM table_a A, table_b B , table_c C WHERE LEFT(A.col1,7) = '2001-01' AND A.col2 = '1' AND A.col3 = B.col2 AND A.col4 = C.col3

Keywords: kbbug kbfix kbqfe kbhotfixserver KB308114

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.