From: <ste...@us...> - 2006-02-16 19:23:36
|
Update of /cvsroot/hibernate/Hibernate3/src/org/hibernate/hql/ast In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14970/src/org/hibernate/hql/ast Modified Files: HqlSqlWalker.java Log Message: disallow fetches in subqueries Index: HqlSqlWalker.java =================================================================== RCS file: /cvsroot/hibernate/Hibernate3/src/org/hibernate/hql/ast/HqlSqlWalker.java,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- HqlSqlWalker.java 13 Feb 2006 15:50:28 -0000 1.116 +++ HqlSqlWalker.java 16 Feb 2006 19:23:22 -0000 1.117 @@ -299,7 +299,10 @@ AST fetchNode, AST propertyFetch, AST with) throws SemanticException { - boolean fetch = ( fetchNode != null ) ? true : false; + boolean fetch = fetchNode != null; + if ( fetch && isSubQuery() ) { + throw new QueryException( "fetch not allowed in subquery from-elements" ); + } // The path AST should be a DotNode, and it should have been evaluated already. if ( path.getType() != SqlTokenTypes.DOT ) { throw new SemanticException( "Path expected for join!" ); |