Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-2560

NoViableAltException with ordering by projection in GroupBy

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.3.0.CR1
    • Component/s: Linq Provider
    • Labels:
    • Sprint:

      Description

      The following unit test fails:

      Test
      public void SingleKeyPropertyGroupWithCriteria()
      {
      var orderCounts = db.Orders
      .GroupBy(o => o.Customer.CustomerId)
      .Select(g =>
      new

      { CustomerId = g.Key, OrderCount = g.Count() }

      )
      .OrderByDescending(t=>t.OrderCount)
      .ToList();
      }

      (apologies, I haven't got any results verification in there, but the test fails with NoViableAltException before that at the moment).

      Moving the ORDER BY to use g.Count() before the projection also fails.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                james.crowley James Crowley
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?