|
From: <fab...@us...> - 2009-10-18 19:18:09
|
Revision: 4788
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4788&view=rev
Author: fabiomaulo
Date: 2009-10-18 19:18:02 +0000 (Sun, 18 Oct 2009)
Log Message:
-----------
Fixed NH-1858 with 'Not supported exception.'
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs
trunk/nhibernate/src/NHibernate.Test/DialectTest/MsSql2005DialectFixture.cs
Modified: trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs 2009-10-18 19:16:19 UTC (rev 4787)
+++ trunk/nhibernate/src/NHibernate/Dialect/MsSql2000Dialect.cs 2009-10-18 19:18:02 UTC (rev 4788)
@@ -352,7 +352,7 @@
{
return 6;
}
- return 0;
+ throw new NotSupportedException("The query should start with 'SELECT' or 'SELECT DISTINCT'");
}
private bool NeedsLockHint(LockMode lockMode)
Modified: trunk/nhibernate/src/NHibernate.Test/DialectTest/MsSql2005DialectFixture.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/DialectTest/MsSql2005DialectFixture.cs 2009-10-18 19:16:19 UTC (rev 4787)
+++ trunk/nhibernate/src/NHibernate.Test/DialectTest/MsSql2005DialectFixture.cs 2009-10-18 19:18:02 UTC (rev 4788)
@@ -1,3 +1,4 @@
+using System;
using NHibernate.Dialect;
using NHibernate.Mapping;
using NHibernate.SqlCommand;
@@ -184,5 +185,12 @@
System.Console.WriteLine(ifExistsDropConstraint);
Assert.AreEqual(expected, ifExistsDropConstraint);
}
+
+ [Test]
+ public void GetLimitStringWithSqlComments()
+ {
+ var d = new MsSql2005Dialect();
+ Assert.Throws<NotSupportedException>(()=> d.GetLimitString(new SqlString(" /* criteria query */ SELECT p from lcdtm"), 0, 2));
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|