BUG: Parallel Query Generates Access Violation from Derived Table Populated from NULL Parameters (257564)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q257564
BUG #: 57654 (SQLBUG_70)

SYMPTOMS

If your query involves derived tables, it may terminate unexpectedly from an Access Violation (AV) if all of the following conditions are true:
  • The query executes in a parallel plan.
  • The query uses hash joins.
  • One or more of the derived table values is a NULL value.
  • The query uses a UNION to aggregate more than one row into the derived table.

WORKAROUND

To work around this problem, eliminate any one of the criteria listed in the "Symptoms" section. For example:
  • Change the max degree of parallelism option to 1 by using the sp_configure stored procedure or add the (MAXDOP = 1) query hint to the query.
  • Force a different type of join.
  • Eliminate NULLS.
  • Do not use UNIONs to aggregate results inside the derived table.
  • Rewrite the query and use temporary tables rather than derived tables.

STATUS

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

MORE INFORMATION

The partial stack trace that follows is from SQL Server 7.0 Enterprise Edition with Service Pack 1 and is included for comparison purposes. The stack trace produced by an AV will be in the SQL Server error log.

Short Stack Dump
0x0044a584 Module(sqlservr+4a584)(CTSet<unsigned long, CFnC_SetDefault>::FMember+4)
0x00669e5d Module(sqlservr+269e5d) (COptExpr::AdjustPartitionColumns+8f)
0x00553177 Module(sqlservr+153177) (COptExpr::PqteConvert+ea)
0x0045c6b8 Module(sqlservr+5c6b8) (CConvertCtx::PqteConvertChild+2d)
0x0067bffc Module(sqlservr+27bffc) (CPhyOp_Concat::PqteConvert+7a)
0x0044599c Module(sqlservr+4599c) (COptExpr::PqteConvert+54)
0x0045c6b8 Module(sqlservr+5c6b8) (CConvertCtx::PqteConvertChild+2d)
0x004ca8d8 Module(sqlservr+ca8d8) (CPhyOp_HashJoin::ConvertBuildInput+136)
0x004ca64f Module(sqlservr+ca64f) (CPhyOp_HashJoin::PqteConvert+12d)
0x0044599c Module(sqlservr+4599c) (COptExpr::PqteConvert+54)
0x0045c6b8 Module(sqlservr+5c6b8) (CConvertCtx::PqteConvertChild+2d)
0x0048fa79 Module(sqlservr+8fa79) (CPhyOp_Sort::PqteConvert+3a)
0x0044599c Module(sqlservr+4599c) (COptExpr::PqteConvert+54)
0x0045c6b8 Module(sqlservr+5c6b8) (CConvertCtx::PqteConvertChild+2d)
				

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug KB257564