Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exists in SELECT that is contained in a CTE causes crash #16

Open
terrajobst opened this issue Oct 31, 2014 · 1 comment
Open

Exists in SELECT that is contained in a CTE causes crash #16

terrajobst opened this issue Oct 31, 2014 · 1 comment

Comments

@terrajobst
Copy link
Owner

Ported from CodePlex

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)

@dallmair
Copy link

Works fine in v.Next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants