Skip to content

Commit ee0b708

Browse files
committed
Ignore tests: Complex group by fails on SQL Server over ODBC, and SQL Server CE.
They seem unable to match complex expression between the select clause and the group by clause.
1 parent d6062f3 commit ee0b708

File tree

2 files changed

+59
-11
lines changed

2 files changed

+59
-11
lines changed

src/NHibernate.Test/Linq/ByMethod/GroupByTests.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Text.RegularExpressions;
66
using NHibernate.Dialect;
77
using NHibernate.DomainModel.Northwind.Entities;
8+
using NHibernate.Driver;
89
using NHibernate.Linq;
910
using NUnit.Framework;
1011

@@ -533,6 +534,10 @@ public void GroupByComputedValue()
533534
{
534535
if (Dialect is FirebirdDialect)
535536
Assert.Ignore("Firebird does not support complex group by expressions");
537+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
538+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
539+
if (Dialect is MsSqlCeDialect)
540+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
536541

537542
var orderGroups = db.Orders.GroupBy(o => o.Customer.CustomerId == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
538543
Assert.AreEqual(830, orderGroups.Sum(g => g.Count));
@@ -543,6 +548,10 @@ public void GroupByComputedValueInAnonymousType()
543548
{
544549
if (Dialect is FirebirdDialect)
545550
Assert.Ignore("Firebird does not support complex group by expressions");
551+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
552+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
553+
if (Dialect is MsSqlCeDialect)
554+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
546555

547556
var orderGroups = db.Orders.GroupBy(o => new { Key = o.Customer.CustomerId == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
548557
Assert.AreEqual(830, orderGroups.Sum(g => g.Count));
@@ -553,6 +562,10 @@ public void GroupByComputedValueInObjectArray()
553562
{
554563
if (Dialect is FirebirdDialect)
555564
Assert.Ignore("Firebird does not support complex group by expressions");
565+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
566+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
567+
if (Dialect is MsSqlCeDialect)
568+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
556569

557570
var orderGroups = db.Orders.GroupBy(o => new[] { o.Customer.CustomerId == null ? 0 : 1, }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
558571
Assert.AreEqual(830, orderGroups.Sum(g => g.Count));
@@ -680,6 +693,10 @@ public void GroupByComputedValueWithJoinOnObject()
680693
{
681694
if (Dialect is FirebirdDialect)
682695
Assert.Ignore("Firebird does not support complex group by expressions");
696+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
697+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
698+
if (Dialect is MsSqlCeDialect)
699+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
683700

684701
var orderGroups = db.OrderLines.GroupBy(o => o.Order.Customer == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
685702
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -690,6 +707,10 @@ public void GroupByComputedValueWithJoinOnId()
690707
{
691708
if (Dialect is FirebirdDialect)
692709
Assert.Ignore("Firebird does not support complex group by expressions");
710+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
711+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
712+
if (Dialect is MsSqlCeDialect)
713+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
693714

694715
var orderGroups = db.OrderLines.GroupBy(o => o.Order.Customer.CustomerId == null ? 0 : 1).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
695716
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -700,6 +721,10 @@ public void GroupByComputedValueInAnonymousTypeWithJoinOnObject()
700721
{
701722
if (Dialect is FirebirdDialect)
702723
Assert.Ignore("Firebird does not support complex group by expressions");
724+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
725+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
726+
if (Dialect is MsSqlCeDialect)
727+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
703728

704729
var orderGroups = db.OrderLines.GroupBy(o => new { Key = o.Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
705730
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -710,6 +735,10 @@ public void GroupByComputedValueInAnonymousTypeWithJoinOnId()
710735
{
711736
if (Dialect is FirebirdDialect)
712737
Assert.Ignore("Firebird does not support complex group by expressions");
738+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
739+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
740+
if (Dialect is MsSqlCeDialect)
741+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
713742

714743
var orderGroups = db.OrderLines.GroupBy(o => new { Key = o.Order.Customer.CustomerId == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
715744
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -720,6 +749,10 @@ public void GroupByComputedValueInObjectArrayWithJoinOnObject()
720749
{
721750
if (Dialect is FirebirdDialect)
722751
Assert.Ignore("Firebird does not support complex group by expressions");
752+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
753+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
754+
if (Dialect is MsSqlCeDialect)
755+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
723756

724757
var orderGroups = db.OrderLines.GroupBy(o => new[] { o.Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
725758
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -730,6 +763,10 @@ public void GroupByComputedValueInObjectArrayWithJoinOnId()
730763
{
731764
if (Dialect is FirebirdDialect)
732765
Assert.Ignore("Firebird does not support complex group by expressions");
766+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
767+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
768+
if (Dialect is MsSqlCeDialect)
769+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
733770

734771
var orderGroups = db.OrderLines.GroupBy(o => new[] { o.Order.Customer.CustomerId == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
735772
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -740,6 +777,10 @@ public void GroupByComputedValueInObjectArrayWithJoinInRightSideOfCase()
740777
{
741778
if (Dialect is FirebirdDialect)
742779
Assert.Ignore("Firebird does not support complex group by expressions");
780+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
781+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
782+
if (Dialect is MsSqlCeDialect)
783+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
743784

744785
var orderGroups = db.OrderLines.GroupBy(o => new[] { o.Order.Customer.CustomerId == null ? "unknown" : o.Order.Customer.CompanyName }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
745786
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -750,6 +791,10 @@ public void GroupByComputedValueFromNestedArraySelect()
750791
{
751792
if (Dialect is FirebirdDialect)
752793
Assert.Ignore("Firebird does not support complex group by expressions");
794+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
795+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
796+
if (Dialect is MsSqlCeDialect)
797+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
753798

754799
var orderGroups = db.OrderLines.Select(o => new object[] { o }).GroupBy(x => new object[] { ((OrderLine)x[0]).Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
755800
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
@@ -760,6 +805,10 @@ public void GroupByComputedValueFromNestedObjectSelect()
760805
{
761806
if (Dialect is FirebirdDialect)
762807
Assert.Ignore("Firebird does not support complex group by expressions");
808+
if (sessions.ConnectionProvider.Driver is OdbcDriver)
809+
Assert.Ignore("SQL Server seems unable to match complex group by and select list arguments when running over ODBC.");
810+
if (Dialect is MsSqlCeDialect)
811+
Assert.Ignore("SQL Server CE does not support complex group by expressions.");
763812

764813
var orderGroups = db.OrderLines.Select(o => new { OrderLine = (object)o }).GroupBy(x => new object[] { ((OrderLine)x.OrderLine).Order.Customer == null ? 0 : 1 }).Select(g => new { Key = g.Key, Count = g.Count() }).ToList();
765814
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));

src/NHibernate.Test/NHSpecificTest/NH3844/Fixture.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
1-
using System;
2-
using System.Collections;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Linq.Expressions;
6-
using System.Reflection;
7-
using System.Text;
8-
using System.Threading;
1+
using System.Linq;
92
using NHibernate.Dialect;
3+
using NHibernate.Driver;
4+
using NHibernate.Engine;
105
using NHibernate.Linq;
11-
using NHibernate.Test.ExceptionsTest;
12-
using NHibernate.Test.MappingByCode;
136
using NUnit.Framework;
147

158
namespace NHibernate.Test.NHSpecificTest.NH3844
@@ -19,7 +12,13 @@ public class Fixture : BugTestCase
1912
{
2013
protected override bool AppliesTo(Dialect.Dialect dialect)
2114
{
22-
return !(dialect is FirebirdDialect);
15+
return !(dialect is FirebirdDialect) && !(dialect is MsSqlCeDialect);
16+
}
17+
18+
protected override bool AppliesTo(ISessionFactoryImplementor factory)
19+
{
20+
// SQL Server seems unable to match complex group by and select list arguments when running over ODBC.";
21+
return !(factory.ConnectionProvider.Driver is OdbcDriver);
2322
}
2423

2524
protected override void OnSetUp()

0 commit comments

Comments
 (0)