Microsoft KB Archive/274588

= BUG: SELECT with GROUP BY and WITH ROLLUP Results in Access Violation =

Article ID: 274588

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft SQL Server 7.0 Standard Edition

-



This article was previously published under Q274588



BUG #: 58414 (SQLBUG_70)



SYMPTOMS
If you perform a SELECT with GROUP BY and WITH ROLLUP on a derived table as follows SELECT c1, c2, c3, c4 FROM (SELECT 'a', 'b', 'c', 'd') AS c(c1, c2, c3, c4 ) GROUP BY c1, c2, c3, c4 WITH ROLLUP you may receive the following error message:

ODBC: Msg 0, Level 19, State 1

SqlDumpExceptionHandler: Process 7 generated fatal exception c0000005

EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Connection Broken

In addition, an access violation/stack dump is logged in the SQL Server error log: Short Stack Dump 0x0064b01a Module(sqlservr+24b01a) (CValRefCalculated::EvsSupports+2) 0x0041835e Module(sqlservr+1835e) (CEsCompValSeg::EvsCountIdent+22) 0x00417fb3 Module(sqlservr+17fb3) (CScan1Context::Scan1+18d) 0x0041817e Module(sqlservr+1817e) (CScan1Context::Scan1+2f9) 0x00417e0e Module(sqlservr+17e0e) (CEsComp::CompileScan1+25) 0x00417d3b Module(sqlservr+17d3b) (CEs::Compile+80) 0x0078a051 Module(sqlservr+38a051) (streambuf::setbuf+3d14) 0x00476767 Module(sqlservr+76767) (CXteStreamAggregate::IntermediateCompile+93) 0x00444a81 Module(sqlservr+44a81) (CXte::ExecCompile+14e) 0x0045dc96 Module(sqlservr+5dc96) (CXteProject::ExecCompile+f2) 0x0044ab93 Module(sqlservr+4ab93) (CQuery::Prepare+b4) 0x00445f4b Module(sqlservr+45f4b) (CCvtTree::PqryFromTree+7eb) 0x00445c74 Module(sqlservr+45c74) (BuildQueryFromTree+60) 0x00445b13 Module(sqlservr+45b13) (CStmtQuery::InitQuery+c8) 0x0046aa97 Module(sqlservr+6aa97) (CStmtSelect::Init+6c) 0x0043676d Module(sqlservr+3676d) (CCompPlan::FCompileStep+771) 0x0043b503 Module(sqlservr+3b503) (CProchdr::FCompile+5d7) 0x00413dbd Module(sqlservr+13dbd) (CSQLSource::FTransform+233) 0x00480033 Module(sqlservr+80033) (CSQLStrings::FTransform+158) 0x00413923 Module(sqlservr+13923) (CSQLSource::Execute+11c) 0x0047fd57 Module(sqlservr+7fd57) (language_exec+396) 0x41061253 Module(opends60+1253) (execute_event+658) 0x410614a1 Module(opends60+14a1) (process_commands+f2) 0x41092a47 Module(ums+2a47) (ProcessWorkRequests+ec) 0x4109326b Module(ums+326b) (ThreadStartRoutine+138) 0x7800bea1 Module(MSVCRT+bea1) (beginthread+ce) 0x77e837cd Module(KERNEL32+37cd) (TlsSetValue+f0)



WORKAROUND
Instead of using the derived table, use a temporary table: CREATE TABLE #t(c1 char(1), c2 char(1), c3 char(1), c4 char(1)) INSERT INTO #t VALUES ( 'a', 'b', 'c', 'd' ) go SELECT c1, c2 , c3 , c4 FROM #t GROUP BY c1, c2, c3, c4 WITH ROLLUP



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

Keywords: kbbug kbpending KB274588

-

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

© Microsoft Corporation. All rights reserved.