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

Order by in CTE causes ArgumentException #15

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

Order by in CTE causes ArgumentException #15

terrajobst opened this issue Oct 31, 2014 · 1 comment

Comments

@terrajobst
Copy link
Owner

Ported from CodePlex

WITH test AS (
 SELECT TOP 1
   e.FirstName AS test,
   e.LastName AS f,
   e.Extension
 FROM Employees e

 ORDER BY 1
)
SELECT t.f
FROM test t

System.ArgumentException: IComparer (or the IComparable methods it relies upon) did not return zero when Array.Sort called x. CompareTo(x). x: 'System.Object[]'  x's type: 'Object[]' The IComparer: 'NQuery.Runtime.ExecutionPlan.SortIterator+RowComparer'.
   at System.Collections.Generic.ArraySortHelper1.SwapIfGreaterWithItems[TValue](T[] keys, TValue[] values, IComparer1 comparer, Int32 a, Int32 b)
   at System.Collections.Generic.ArraySortHelper1.QuickSort[TValue](T[] keys, TValue[] values, Int32 left, Int32 right, IComparer1 comparer)
   at System.Collections.Generic.ArraySortHelper1.Sort[TValue](T[] keys, TValue[] values, Int32 index, Int32 length, IComparer1 comparer)
   at System.Collections.Generic.ArraySortHelper1.Sort(T[] items, Int32 index, Int32 length, IComparer1 comparer)
   at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer1 comparer)    at System.Collections.Generic.List1.Sort(Int32 index, Int32 count, IComparer1 comparer)    at System.Collections.Generic.List1.Sort(IComparer`1 comparer)
   at NQuery.Runtime.ExecutionPlan.SortIterator.SortInput() in N:\Trunk\Src\NQuery\Execution Plan\SortIterator.cs:line 100
   at NQuery.Runtime.ExecutionPlan.SortIterator.Read() in N:\Trunk\Src\NQuery\Execution Plan\SortIterator.cs:line 113
   at NQuery.Runtime.ExecutionPlan.StatisticsIterator.Read() in N:\Trunk\Src\NQuery\Execution Plan\StatisticsIterator.cs:line 25
   at NQuery.Runtime.ExecutionPlan.TopIterator.Read() in N:\Trunk\Src\NQuery\Execution Plan\TopIterator.cs:line 23
   at NQuery.Runtime.ExecutionPlan.StatisticsIterator.Read() in N:\Trunk\Src\NQuery\Execution Plan\StatisticsIterator.cs:line 25
   at NQuery.Runtime.ExecutionPlan.ResultIterator.Read() in N:\Trunk\Src\NQuery\Execution Plan\ResultIterator.cs:line 18
   at NQuery.Query.ExecuteDataTable() in N:\Trunk\Src\NQuery\API\Query.cs:line 133
   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.executeToolStripMenuItem_Click(Object sender, EventArgs e) in N:\Trunk\Src\NQuery.Gui\MainForm.cs:line 282
   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