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

Full outer join with CTE causes NullReference #10

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

Full outer join with CTE causes NullReference #10

terrajobst opened this issue Oct 31, 2014 · 1 comment

Comments

@terrajobst
Copy link
Owner

Ported from CodePlex

WITH D AS (
 SELECT o.OrderDate,
   od.Quantity * od.UnitPrice * (1 - od.Discount) AS Price
 FROM Orders o,
   [Order Details] od
 WHERE od.OrderID = o.OrderID
)
SELECT *
FROM D AS D1
   FULL JOIN D AS D2 ON D1.OrderDate >= D2.OrderDate

Replacing the join type by an inner join or replacing the >= by the = works fine.

System.NullReferenceException: Object reference not set to an instance of an object.
   at NQuery.Compilation.HashMatchAlgebraNode.Clone(Dictionary`2 alreadyClonedElements) in N:\Trunk\Src\NQuery\AST\Algebra\HashMatchAlgebraNode.cs:line 66
   at NQuery.Compilation.AstElement.Clone() in N:\Trunk\Src\NQuery\AST\AstElement.cs:line 18
   at NQuery.Compilation.FullOuterJoinExpander.VisitJoinAlgebraNode(JoinAlgebraNode node) in N:\Trunk\Src\NQuery\Compilation\FullOuterJoinExpander.cs:line 19
   at NQuery.Compilation.StandardVisitor.Visit(AstNode node) in N:\Trunk\Src\NQuery\AST\Visitor\StandardVisitor.cs:line 84
   at NQuery.Compilation.StandardVisitor.VisitAlgebraNode(AlgebraNode node) in N:\Trunk\Src\NQuery\AST\Visitor\StandardVisitor.cs:line 409
   at NQuery.Compilation.StandardVisitor.VisitResultAlgebraNode(ResultAlgebraNode node) in N:\Trunk\Src\NQuery\AST\Visitor\StandardVisitor.cs:line 503
   at NQuery.Compilation.StandardVisitor.Visit(AstNode node) in N:\Trunk\Src\NQuery\AST\Visitor\StandardVisitor.cs:line 102
   at NQuery.Compilation.Compiler.PhaseCollection.<>c__DisplayClass6.b__5(AstNode input) in N:\Trunk\Src\NQuery\Compilation\Compiler.cs:line 95
   at NQuery.Compilation.Compiler.PhaseRunner.Run() in N:\Trunk\Src\NQuery\Compilation\Compiler.cs:line 118
   at NQuery.Compilation.Compiler.CompileQuery(String queryText, Scope scope) in N:\Trunk\Src\NQuery\Compilation\Compiler.cs:line 199
   at NQuery.Query.Compile() in N:\Trunk\Src\NQuery\API\Query.cs:line 90
   at NQuery.Query.EnsureCompiled() in N:\Trunk\Src\NQuery\API\Query.cs:line 75
   at NQuery.Query.ExecuteDataTable() in N:\Trunk\Src\NQuery\API\Query.cs:line 127
   at NQuery.Gui.QueryDocument.Execute() in N:\Trunk\Src\NQuery.Gui\QueryDocument.cs:line 196
   at NQuery.Gui.QueryDocument.NQuery.Gui.IQueryHandler.Execute() in N:\Trunk\Src\NQuery.Gui\QueryDocument.cs:line 135
   at NQuery.Gui.MainForm.executeToolStripButton_Click(Object sender, EventArgs e) in N:\Trunk\Src\NQuery.Gui\MainForm.cs:line 383
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

@dallmair
Copy link

Works fine in v.Next (result also looks good to me).

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