Microsoft KB Archive/271476

{|
 * width="100%"|

BUG: SELECT Statement That Contains GROUP BY ALL in a Correlated Subquery Fails

 * }

Q271476

-

The information in this article applies to:


 * Microsoft SQL Server version 7.0
 * Microsoft SQL Server 2000

-

BUG #: 57881 (SQLBUG_70)

BUG #: 229658 (SHILOH)

SYMPTOMS
A SELECT statement that contains ALL in a GROUP BY clause in a nested correlated subquery may fail with the following error message in SQL Server 7.0:

ODBC: Msg 0, Level 19, State 1

SqlDumpExceptionHandler: Process 8 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

On SQL Server 2000, the following error message is returned:

Msg 8624, Level 16, State 24, Line 1

Internal SQL Server error.

STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION
The following query demonstrates the problem:

SELECT * FROM pubs..authors a WHERE (SELECT distinct count (title_id)    FROM pubs..titleauthor     WHERE au_id =  a.au_id     GROUP BY ALL au_id ) =1 go On SQL Server 7.0, the stack dump in the errorlog resembles the following:

Short Stack Dump 0x0047f904 Module(sqlservr+7f904) (CCvtTree::PdrgcidGetColumns+c) 0x006a7c97 Module(sqlservr+2a7c97) (CCvtTree::BuildGbAll+5d8) 0x006a64d7 Module(sqlservr+2a64d7) (CCvtTree::CorrelatedAgg+259) 0x00588bf7 Module(sqlservr+188bf7) (CCvtTree::PexprBuildFrom+3d6) 0x004b3645 Module(sqlservr+b3645) (CCvtTree::PexprFromSubquery+34) 0x004546c8 Module(sqlservr+546c8) (CCvtTree::PexprFromScalar+277) 0x00454872 Module(sqlservr+54872) (CCvtTree::PexprFromCompare+17) 0x004545be Module(sqlservr+545be) (CCvtTree::PexprFromScalar+1e5) 0x00454727 Module(sqlservr+54727) (CCvtTree::PexprFromLogical+4f) 0x00454652 Module(sqlservr+54652) (CCvtTree::PexprFromScalar+1fe) 0x00455cad Module(sqlservr+55cad) (CCvtTree::PexprBuildSelect+a7) 0x00446447 Module(sqlservr+46447) (CCvtTree::PexprFromCmdlist+298) 0x00445eba Module(sqlservr+45eba) (CCvtTree::PqryFromTree+2f0) 0x00445c74 Module(sqlservr+45c74) (BuildQueryFromTree+61) 0x00445b13 Module(sqlservr+45b13) (CStmtQuery::InitQuery+c9) 0x0046aa97 Module(sqlservr+6aa97) (CStmtSelect::Init+6d) 0x0043676d Module(sqlservr+3676d) (CCompPlan::FCompileStep+772) 0x0043b503 Module(sqlservr+3b503) (CProchdr::FCompile+5d8) 0x00413dbd Module(sqlservr+13dbd) (CSQLSource::FTransform+234) 0x00480033 Module(sqlservr+80033) (CSQLStrings::FTransform+159) 0x00413923 Module(sqlservr+13923) (CSQLSource::Execute+11d) 0x0047fd57 Module(sqlservr+7fd57) (language_exec+397) 0x41061253 Module(opends60+1253) (execute_event+659) 0x410614a1 Module(opends60+14a1) (process_commands+f3) 0x41092a47 Module(ums+2a47) (ProcessWorkRequests+ed) 0x4109326b Module(ums+326b) (ThreadStartRoutine+139) 0x7800bea1 Module(MSVCRT+bea1) (beginthread+ce) 0x77e92ca8 Module(KERNEL32+12ca8) (CreateFileA+11b) 0x00000000 Module(sqlservr+ffc00000) Additional query words: av nested

Keywords :

Issue type : kbbug

Technology :