File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
NHibernate/Hql/Ast/ANTLR/Tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,17 @@ public async Task MultipleParametersInCaseStatementAsync()
141141 }
142142 }
143143
144+ [ Test ]
145+ public async Task ParametersInCaseThenClauseAsync ( )
146+ {
147+ using ISession s = OpenSession ( ) ;
148+ var result = await ( s . CreateQuery ( "select a from Animal a where (case when 2=2 then ? else ? end) = 1" )
149+ . SetParameter ( 0 , 1 )
150+ . SetParameter ( 1 , 0 )
151+ . UniqueResultAsync ( ) ) ;
152+ Assert . AreEqual ( null , result ) ;
153+ }
154+
144155 [ Test ]
145156 public async Task ParameterInCaseThenClauseAsync ( )
146157 {
Original file line number Diff line number Diff line change @@ -147,6 +147,17 @@ public void MultipleParametersInCaseStatement()
147147 }
148148 }
149149
150+ [ Test ]
151+ public void ParametersInCaseThenClause ( )
152+ {
153+ using ISession s = OpenSession ( ) ;
154+ var result = s . CreateQuery ( "select a from Animal a where (case when 2=2 then ? else ? end) = 1" )
155+ . SetParameter ( 0 , 1 )
156+ . SetParameter ( 1 , 0 )
157+ . UniqueResult ( ) ;
158+ Assert . AreEqual ( null , result ) ;
159+ }
160+
150161 [ Test ]
151162 public void ParameterInCaseThenClause ( )
152163 {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public override IType DataType
3535 return select . DataType ;
3636 }
3737
38- throw new HibernateException ( "Unable to determine data type of CASE statement." ) ;
38+ return base . DataType ;
3939 }
4040 set { base . DataType = value ; }
4141 }
You can’t perform that action at this time.
0 commit comments