Skip to content

Commit 8876457

Browse files
NH-3488 - fix dialect dependent failures, second round, to be squashed.
1 parent b996884 commit 8876457

File tree

2 files changed

+99
-3
lines changed

2 files changed

+99
-3
lines changed

src/NHibernate.Test/Hql/Ast/BulkManipulation.cs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ public void IncorrectSyntax()
379379
[Test]
380380
public void UpdateWithWhereExistsSubquery()
381381
{
382+
if (!Dialect.SupportsTemporaryTables)
383+
{
384+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
385+
}
386+
382387
// multi-table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383388
ISession s = OpenSession();
384389
ITransaction t = s.BeginTransaction();
@@ -521,6 +526,11 @@ public void IncrementTimestampVersion()
521526
[Test]
522527
public void UpdateOnComponent()
523528
{
529+
if (!Dialect.SupportsTemporaryTables)
530+
{
531+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
532+
}
533+
524534
ISession s = OpenSession();
525535
ITransaction t = s.BeginTransaction();
526536

@@ -552,6 +562,11 @@ public void UpdateOnComponent()
552562
[Test]
553563
public void UpdateOnManyToOne()
554564
{
565+
if (!Dialect.SupportsTemporaryTables)
566+
{
567+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
568+
}
569+
555570
ISession s = OpenSession();
556571
ITransaction t = s.BeginTransaction();
557572

@@ -638,6 +653,11 @@ public void UpdateOnDiscriminatorSubclass()
638653
[Test]
639654
public void UpdateOnAnimal()
640655
{
656+
if (!Dialect.SupportsTemporaryTables)
657+
{
658+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
659+
}
660+
641661
var data = new TestData(this);
642662
data.Prepare();
643663

@@ -682,6 +702,11 @@ public void UpdateOnAnimal()
682702
[Test]
683703
public void UpdateMultiplePropertyOnAnimal()
684704
{
705+
if (!Dialect.SupportsTemporaryTables)
706+
{
707+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
708+
}
709+
685710
var data = new TestData(this);
686711
data.Prepare();
687712

@@ -713,6 +738,11 @@ public void UpdateMultiplePropertyOnAnimal()
713738
[Test]
714739
public void UpdateOnMammal()
715740
{
741+
if (!Dialect.SupportsTemporaryTables)
742+
{
743+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
744+
}
745+
716746
var data = new TestData(this);
717747
data.Prepare();
718748

@@ -741,6 +771,11 @@ public void UpdateOnMammal()
741771
[Test]
742772
public void UpdateSetNullUnionSubclass()
743773
{
774+
if (!Dialect.SupportsTemporaryTables)
775+
{
776+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
777+
}
778+
744779
var data = new TestData(this);
745780
data.Prepare();
746781

@@ -800,6 +835,11 @@ public void UpdateSetNullOnDiscriminatorSubclass()
800835
[Test]
801836
public void UpdateSetNullOnJoinedSubclass()
802837
{
838+
if (!Dialect.SupportsTemporaryTables)
839+
{
840+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
841+
}
842+
803843
var data = new TestData(this);
804844
data.Prepare();
805845

@@ -869,7 +909,10 @@ public void SimpleDeleteOnAnimal()
869909
if (Dialect.HasSelfReferentialForeignKeyBug)
870910
{
871911
Assert.Ignore("self referential FK bug", "HQL delete testing");
872-
return;
912+
}
913+
if (!Dialect.SupportsTemporaryTables)
914+
{
915+
Assert.Ignore("Cannot perform multi-table deletes using dialect not supporting temp tables.");
873916
}
874917

875918
var data = new TestData(this);

src/NHibernate.Test/NHSpecificTest/NH3488/LinqBulkManipulationFixture.cs

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ public void InsertWithSelectListUsingJoins()
377377

378378
s.Query<Human>().Where(x => x.Mother.Mother != null)
379379
.Insert().As(x => new Animal { Description = x.Description, BodyWeight = x.BodyWeight });
380-
381-
s.CreateQuery("delete from Animal").ExecuteUpdate();
380+
382381
s.Transaction.Commit();
383382
s.Close();
384383
}
@@ -430,6 +429,11 @@ public void InsertToComponent()
430429
[Test]
431430
public void UpdateWithWhereExistsSubquery()
432431
{
432+
if (!Dialect.SupportsTemporaryTables)
433+
{
434+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
435+
}
436+
433437
// multi-table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
434438
var joe = new Human { Name = new Name { First = "Joe", Initial = 'Q', Last = "Public" } };
435439
var doll = new Human { Name = new Name { First = "Kyu", Initial = 'P', Last = "Doll" }, Friends = new[] { joe } };
@@ -582,6 +586,11 @@ public void IncrementTimestampVersion()
582586
[Test]
583587
public void UpdateOnComponent()
584588
{
589+
if (!Dialect.SupportsTemporaryTables)
590+
{
591+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
592+
}
593+
585594
var human = new Human { Name = new Name { First = "Stevee", Initial = 'X', Last = "Ebersole" } };
586595
using (var s = OpenSession())
587596
{
@@ -643,6 +652,11 @@ public void UpdateWithClientSideRequirementsThrowsException()
643652
[Test]
644653
public void UpdateOnManyToOne()
645654
{
655+
if (!Dialect.SupportsTemporaryTables)
656+
{
657+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
658+
}
659+
646660
using (var s = OpenSession())
647661
using (var t = s.BeginTransaction())
648662
{
@@ -702,6 +716,11 @@ public void UpdateOnDiscriminatorSubclass()
702716
[Test]
703717
public void UpdateOnAnimal()
704718
{
719+
if (!Dialect.SupportsTemporaryTables)
720+
{
721+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
722+
}
723+
705724
using (var s = OpenSession())
706725
using (var t = s.BeginTransaction())
707726
{
@@ -739,6 +758,11 @@ public void UpdateOnAnimal()
739758
[Test]
740759
public void UpdateOnDragonWithProtectedProperty()
741760
{
761+
if (!Dialect.SupportsTemporaryTables)
762+
{
763+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
764+
}
765+
742766
using (var s = OpenSession())
743767
using (var t = s.BeginTransaction())
744768
{
@@ -754,6 +778,11 @@ public void UpdateOnDragonWithProtectedProperty()
754778
[Test]
755779
public void UpdateMultiplePropertyOnAnimal()
756780
{
781+
if (!Dialect.SupportsTemporaryTables)
782+
{
783+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
784+
}
785+
757786
using (var s = OpenSession())
758787
using (var t = s.BeginTransaction())
759788
{
@@ -778,6 +807,11 @@ public void UpdateMultiplePropertyOnAnimal()
778807
[Test]
779808
public void UpdateOnMammal()
780809
{
810+
if (!Dialect.SupportsTemporaryTables)
811+
{
812+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
813+
}
814+
781815
using (var s = OpenSession())
782816
using (var t = s.BeginTransaction())
783817
{
@@ -803,6 +837,11 @@ public void UpdateOnMammal()
803837
[Test]
804838
public void UpdateSetNullUnionSubclass()
805839
{
840+
if (!Dialect.SupportsTemporaryTables)
841+
{
842+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
843+
}
844+
806845
// These should reach out into *all* subclass tables...
807846
using (var s = OpenSession())
808847
using (var t = s.BeginTransaction())
@@ -845,6 +884,11 @@ public void UpdateSetNullOnDiscriminatorSubclass()
845884
[Test]
846885
public void UpdateSetNullOnJoinedSubclass()
847886
{
887+
if (!Dialect.SupportsTemporaryTables)
888+
{
889+
Assert.Ignore("Cannot perform multi-table updates using dialect not supporting temp tables.");
890+
}
891+
848892
using (var s = OpenSession())
849893
using (var t = s.BeginTransaction())
850894
{
@@ -866,6 +910,11 @@ public void UpdateSetNullOnJoinedSubclass()
866910
[Test]
867911
public void DeleteWithSubquery()
868912
{
913+
if (Dialect is MsSqlCeDialect)
914+
{
915+
Assert.Ignore("Test failing on Ms SQL CE.");
916+
}
917+
869918
// setup the test data...
870919
using (var s = OpenSession())
871920
{
@@ -915,6 +964,10 @@ public void SimpleDeleteOnAnimal()
915964
{
916965
Assert.Ignore("Self referential FK bug");
917966
}
967+
if (!Dialect.SupportsTemporaryTables)
968+
{
969+
Assert.Ignore("Cannot perform multi-table deletes using dialect not supporting temp tables.");
970+
}
918971

919972
using (var s = OpenSession())
920973
using (var t = s.BeginTransaction())

0 commit comments

Comments
 (0)