[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-1643) Sub-query as function parameter - either sub-query is missed from SQL or NullPointerException raised
Steve Ebersole (JIRA)
noreply at atlassian.com
Fri Aug 13 20:47:41 EDT 2010
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Steve Ebersole updated HHH-1643:
--------------------------------
Assignee: Steve Ebersole
Fix Version/s: 3.6.0.Beta3
3.5.5
> Sub-query as function parameter - either sub-query is missed from SQL or NullPointerException raised
> ----------------------------------------------------------------------------------------------------
>
> Key: HHH-1643
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1643
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-hql
> Affects Versions: 3.1.2, 3.1.3
> Environment: Hibernate 3.1.2 MS SQL Server 2K
> Reporter: Andy Shelton
> Assignee: Steve Ebersole
> Fix For: 3.5.5, 3.6.0.Beta3
>
> Attachments: hql-sql.patch
>
>
> The HQL grammar HQL (hql.g) allows expressions and sub-queries as parameters to functions, however the SQL Tree Transform grammar (hql-sql.g) does not, it only allows expressions. This means if you pass a sub-query as a parameter to something like "cast" for example, you will get a NullPointerException. In other cases, typically the sub-query is missed out of the resulting SQL. This is easily remedied by changing the first line of the definition of functionCall within hql-sql.g from:
> functionCall
> : #(METHOD_CALL {inFunctionCall=true;} pathAsIdent ( #(EXPR_LIST (expr)* ) )? )
> to:
> functionCall
> : #(METHOD_CALL {inFunctionCall=true;} pathAsIdent ( #(EXPR_LIST (exprOrSubquery)* ) )? )
> This modification has been tested against all the existing UnitTests in Hibernate 3.1.2 and does not cause any problems.
> I've included a patch for this.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list