|
From: <fab...@us...> - 2009-07-04 15:45:58
|
Revision: 4570
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=4570&view=rev
Author: fabiomaulo
Date: 2009-07-04 15:45:57 +0000 (Sat, 04 Jul 2009)
Log Message:
-----------
Merge r4569 (fix NH-1859)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/Engine/Query/ParameterParser.cs
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/DomainClass.cs
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/Mappings.hbm.xml
trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/SampleTest.cs
Modified: trunk/nhibernate/src/NHibernate/Engine/Query/ParameterParser.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/Engine/Query/ParameterParser.cs 2009-07-04 15:42:33 UTC (rev 4569)
+++ trunk/nhibernate/src/NHibernate/Engine/Query/ParameterParser.cs 2009-07-04 15:45:57 UTC (rev 4570)
@@ -56,7 +56,7 @@
// check comments
if (indx + 1 < stringLength && sqlString.Substring(indx,2) == "/*")
{
- var closeCommentIdx = sqlString.IndexOf("*/");
+ var closeCommentIdx = sqlString.IndexOf("*/", indx+2);
recognizer.Other(sqlString.Substring(indx, (closeCommentIdx- indx)+2));
indx = closeCommentIdx + 1;
continue;
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/DomainClass.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/DomainClass.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/DomainClass.cs 2009-07-04 15:45:57 UTC (rev 4570)
@@ -0,0 +1,7 @@
+namespace NHibernate.Test.NHSpecificTest.NH1859
+{
+ public class DomainClass
+ {
+ public int Id { get; set; }
+ }
+}
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/Mappings.hbm.xml
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/Mappings.hbm.xml (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/Mappings.hbm.xml 2009-07-04 15:45:57 UTC (rev 4570)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernate.Test"
+ namespace="NHibernate.Test.NHSpecificTest.NH1859"
+ default-lazy="false">
+ <class name="DomainClass">
+ <id name="Id">
+ <generator class="assigned" />
+ </id>
+ </class>
+</hibernate-mapping>
Added: trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/SampleTest.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/SampleTest.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/NHSpecificTest/NH1859/SampleTest.cs 2009-07-04 15:45:57 UTC (rev 4570)
@@ -0,0 +1,40 @@
+using NUnit.Framework;
+
+namespace NHibernate.Test.NHSpecificTest.NH1859
+{
+ [TestFixture]
+ public class SampleTest : BugTestCase
+ {
+ protected override void OnSetUp()
+ {
+ base.OnSetUp();
+ using (ISession session = OpenSession())
+ {
+ session.Save(new DomainClass {Id = 1});
+ session.Flush();
+ }
+ }
+
+ protected override void OnTearDown()
+ {
+ base.OnTearDown();
+ using (ISession session = OpenSession())
+ {
+ session.Delete("from DomainClass");
+ session.Flush();
+ }
+ }
+
+ [Test]
+ public void NativeQueryWithTwoComments()
+ {
+ using (ISession session = OpenSession())
+ {
+ IQuery qry = session.CreateSQLQuery("select /* first comment */ o.* /* second comment*/ from domainclass o")
+ .AddEntity("o", typeof (DomainClass));
+ var res = qry.List<DomainClass>();
+ Assert.AreEqual(res[0].Id, 1);
+ }
+ }
+ }
+}
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-07-04 15:42:33 UTC (rev 4569)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2009-07-04 15:45:57 UTC (rev 4570)
@@ -533,6 +533,8 @@
<Compile Include="NHSpecificTest\NH1849\Fixture.cs" />
<Compile Include="NHSpecificTest\NH1850\Customer.cs" />
<Compile Include="NHSpecificTest\NH1850\Fixture.cs" />
+ <Compile Include="NHSpecificTest\NH1859\DomainClass.cs" />
+ <Compile Include="NHSpecificTest\NH1859\SampleTest.cs" />
<Compile Include="NHSpecificTest\NH1864\Fixture.cs" />
<Compile Include="NHSpecificTest\NH1864\Model.cs" />
<Compile Include="NHSpecificTest\NH473\Child.cs" />
@@ -1946,6 +1948,7 @@
<EmbeddedResource Include="DriverTest\MultiTypeEntity.hbm.xml" />
<EmbeddedResource Include="Criteria\Lambda\Mappings.hbm.xml" />
<Content Include="DynamicEntity\package.html" />
+ <EmbeddedResource Include="NHSpecificTest\NH1859\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1864\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1849\Mappings.hbm.xml" />
<EmbeddedResource Include="NHSpecificTest\NH1850\Mappings.hbm.xml" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|