File tree Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Expand file tree Collapse file tree 3 files changed +30
-2
lines changed Original file line number Diff line number Diff line change
1
+ using System . Linq ;
2
+ using NHibernate . Hql . Ast . ANTLR ;
3
+ using NUnit . Framework ;
4
+ using SharpTestsEx ;
5
+
6
+ namespace NHibernate . Test . NHSpecificTest . NH2293
7
+ {
8
+ public class Fixture : BugTestCase
9
+ {
10
+ protected override System . Collections . IList Mappings
11
+ {
12
+ get
13
+ {
14
+ return Enumerable . Empty < object > ( ) . ToList ( ) ;
15
+ }
16
+ }
17
+
18
+ [ Test ]
19
+ public void WhenQueryHasJustAfromThenThrowQuerySyntaxException ( )
20
+ {
21
+ using ( ISession session = OpenSession ( ) )
22
+ {
23
+ session . Executing ( s => s . CreateQuery ( "from" ) . List ( ) ) . Throws < QuerySyntaxException > ( ) ;
24
+ }
25
+ }
26
+ }
27
+ }
Original file line number Diff line number Diff line change 465
465
<Compile Include =" NHSpecificTest\NH2266\Fixture.cs" />
466
466
<Compile Include =" NHSpecificTest\NH2287\Domain.cs" />
467
467
<Compile Include =" NHSpecificTest\NH2287\Fixture.cs" />
468
+ <Compile Include =" NHSpecificTest\NH2293\Fixture.cs" />
468
469
<Compile Include =" NHSpecificTest\NH2294\Fixture.cs" />
469
470
<Compile Include =" TypesTest\CharClass.cs" />
470
471
<Compile Include =" TypesTest\CharClassFixture.cs" />
Original file line number Diff line number Diff line change @@ -134,8 +134,8 @@ public void WeakKeywords()
134
134
// Case 2: The current token is after FROM and before '.'.
135
135
if ( t != IDENT && input . LA ( - 1 ) == FROM && ( ( input . LA ( 2 ) == DOT ) || ( input . LA ( 2 ) == IDENT ) || ( input . LA ( 2 ) == - 1 ) ) )
136
136
{
137
- HqlToken hqlToken = ( HqlToken ) input . LT ( 1 ) ;
138
- if ( hqlToken . PossibleId )
137
+ HqlToken hqlToken = input . LT ( 1 ) as HqlToken ;
138
+ if ( hqlToken != null && hqlToken . PossibleId )
139
139
{
140
140
hqlToken . Type = IDENT ;
141
141
if ( log . IsDebugEnabled )
You can’t perform that action at this time.
0 commit comments