@@ -18,7 +18,7 @@ static HQLFunctions()
1818 notSupportedStandardFunction =
1919 new Hashtable
2020 {
21- { "locate" , new [ ] { typeof ( FirebirdDialect ) , typeof ( PostgreSQLDialect ) , typeof ( SQLiteDialect ) } } ,
21+ { "locate" , new [ ] { typeof ( SQLiteDialect ) } } ,
2222 { "bit_length" , new [ ] { typeof ( SQLiteDialect ) } } ,
2323 { "extract" , new [ ] { typeof ( SQLiteDialect ) } } ,
2424 { "nullif" , new [ ] { typeof ( Oracle8iDialect ) } }
@@ -83,12 +83,12 @@ public void AggregateCount()
8383 Assert . AreEqual ( 2 , result ) ;
8484
8585 // Count in where
86- if ( TestDialect . SupportsHavingWithoutGroupBy )
87- {
88- result = s . CreateQuery ( "select count(a.id) from Animal a having count(a.id)>1" ) . UniqueResult ( ) ;
89- Assert . AreEqual ( typeof ( long ) , result . GetType ( ) ) ;
90- Assert . AreEqual ( 2 , result ) ;
91- }
86+ if ( TestDialect . SupportsHavingWithoutGroupBy )
87+ {
88+ result = s . CreateQuery ( "select count(a.id) from Animal a having count(a.id)>1" ) . UniqueResult ( ) ;
89+ Assert . AreEqual ( typeof ( long ) , result . GetType ( ) ) ;
90+ Assert . AreEqual ( 2 , result ) ;
91+ }
9292 }
9393 }
9494
@@ -111,12 +111,12 @@ public void AggregateAvg()
111111 Assert . AreEqual ( 15D , result ) ;
112112
113113 // In where
114- if ( TestDialect . SupportsHavingWithoutGroupBy )
115- {
116- result = s . CreateQuery ( "select avg(a.BodyWeight) from Animal a having avg(a.BodyWeight)>0" ) . UniqueResult ( ) ;
117- Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
118- Assert . AreEqual ( 15D , result ) ;
119- }
114+ if ( TestDialect . SupportsHavingWithoutGroupBy )
115+ {
116+ result = s . CreateQuery ( "select avg(a.BodyWeight) from Animal a having avg(a.BodyWeight)>0" ) . UniqueResult ( ) ;
117+ Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
118+ Assert . AreEqual ( 15D , result ) ;
119+ }
120120 }
121121 }
122122
@@ -137,12 +137,12 @@ public void AggregateMax()
137137 Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
138138 Assert . AreEqual ( 20F , result ) ;
139139
140- if ( TestDialect . SupportsHavingWithoutGroupBy )
141- {
142- result = s . CreateQuery ( "select max(a.BodyWeight) from Animal a having max(a.BodyWeight)>0" ) . UniqueResult ( ) ;
143- Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
144- Assert . AreEqual ( 20F , result ) ;
145- }
140+ if ( TestDialect . SupportsHavingWithoutGroupBy )
141+ {
142+ result = s . CreateQuery ( "select max(a.BodyWeight) from Animal a having max(a.BodyWeight)>0" ) . UniqueResult ( ) ;
143+ Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
144+ Assert . AreEqual ( 20F , result ) ;
145+ }
146146 }
147147 }
148148
@@ -163,12 +163,12 @@ public void AggregateMin()
163163 Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
164164 Assert . AreEqual ( 10F , result ) ;
165165
166- if ( TestDialect . SupportsHavingWithoutGroupBy )
167- {
168- result = s . CreateQuery ( "select min(a.BodyWeight) from Animal a having min(a.BodyWeight)>0" ) . UniqueResult ( ) ;
169- Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
170- Assert . AreEqual ( 10F , result ) ;
171- }
166+ if ( TestDialect . SupportsHavingWithoutGroupBy )
167+ {
168+ result = s . CreateQuery ( "select min(a.BodyWeight) from Animal a having min(a.BodyWeight)>0" ) . UniqueResult ( ) ;
169+ Assert . AreEqual ( typeof ( float ) , result . GetType ( ) ) ; //use column type
170+ Assert . AreEqual ( 10F , result ) ;
171+ }
172172 }
173173 }
174174
@@ -189,12 +189,12 @@ public void AggregateSum()
189189 Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
190190 Assert . AreEqual ( 30D , result ) ;
191191
192- if ( TestDialect . SupportsHavingWithoutGroupBy )
193- {
194- result = s . CreateQuery ( "select sum(a.BodyWeight) from Animal a having sum(a.BodyWeight)>0" ) . UniqueResult ( ) ;
195- Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
196- Assert . AreEqual ( 30D , result ) ;
197- }
192+ if ( TestDialect . SupportsHavingWithoutGroupBy )
193+ {
194+ result = s . CreateQuery ( "select sum(a.BodyWeight) from Animal a having sum(a.BodyWeight)>0" ) . UniqueResult ( ) ;
195+ Assert . AreEqual ( typeof ( double ) , result . GetType ( ) ) ;
196+ Assert . AreEqual ( 30D , result ) ;
197+ }
198198 }
199199 }
200200
@@ -261,9 +261,9 @@ public void SubStringTwoParameters()
261261 {
262262 hql = "from Animal a where substring(concat(a.Description, ?), :start) = 'deffoo'" ;
263263 result = ( Animal ) s . CreateQuery ( hql )
264- . SetParameter ( 0 , "foo" )
265- . SetParameter ( "start" , 4 )
266- . UniqueResult ( ) ;
264+ . SetParameter ( 0 , "foo" )
265+ . SetParameter ( "start" , 4 )
266+ . UniqueResult ( ) ;
267267 Assert . AreEqual ( "abcdef" , result . Description ) ;
268268 }
269269 }
0 commit comments