This project has moved and is read-only. For the latest updates, please go here.
0

Closed

Exists in SELECT that is contained in a CTE causes crash

description

For example, this query crashes:

WITH Employees AS (
 SELECT t.TerritoryDescription,
   EXISTS (
    SELECT *
    FROM EmployeeTerritories et
    WHERE et.TerritoryID = t.TerritoryID
   ) AS HasAssignedEmployees
 FROM Territories t
)
SELECT *
FROM Employees

System.NullReferenceException: Object reference not set to an instance of an object.
   at NQuery.Compilation.ShowPlanBuilder.WriteRowBufferEntry(PropertyListBuilder builder, RowBufferEntry rowBufferColumn) in N:\Trunk\Src\NQuery\Compilation\ShowPlanBuilder.cs:line 282
   at NQuery.Compilation.ShowPlanBuilder.VisitResultAlgebraNode(ResultAlgebraNode node) in N:\Trunk\Src\NQuery\Compilation\ShowPlanBuilder.cs:line 375
   at NQuery.Compilation.StandardVisitor.Visit(AstNode node) in N:\Trunk\Src\NQuery\AST\Visitor\StandardVisitor.cs:line 102
   at NQuery.Compilation.ShowPlanBuilder.ConvertNode(AlgebraNode node) in N:\Trunk\Src\NQuery\Compilation\ShowPlanBuilder.cs:line 199
   at NQuery.Compilation.ShowPlanBuilder.Convert(AlgebraNode algebraNode) in N:\Trunk\Src\NQuery\Compilation\ShowPlanBuilder.cs:line 82
   at NQuery.ShowPlan.Build(AlgebraNode root) in N:\Trunk\Src\NQuery\API\Show Plan\ShowPlan.cs:line 26
   at NQuery.Query.GetShowPlan() in N:\Trunk\Src\NQuery\API\Query.cs:line 117
   at NQuery.Gui.QueryDocument.ExplainQuery() in N:\Trunk\Src\NQuery.Gui\QueryDocument.cs:line 248
   at NQuery.Gui.QueryDocument.NQuery.Gui.IQueryHandler.ShowPlan() in N:\Trunk\Src\NQuery.Gui\QueryDocument.cs:line 140
   at NQuery.Gui.MainForm.explainToolStripMenuItem_Click(Object sender, EventArgs e) in N:\Trunk\Src\NQuery.Gui\MainForm.cs:line 289
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.ProcessCmdKey(Message& m, Keys keyData)
   at System.Windows.Forms.ToolStripManager.ProcessShortcut(Message& m, Keys shortcut)
   at System.Windows.Forms.Form.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at TD.SandDock.DocumentContainer.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at TD.SandDock.DockControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.ContainerControl.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Application.ThreadContext.PreTranslateMessage(MSG& msg)
Closed Oct 31, 2014 at 7:19 AM by terrajobst

comments