[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2639) HQL parser treats closing (right) parenthesis wrong

Max Rydahl Andersen (JIRA) noreply at atlassian.com
Tue May 29 05:45:04 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Max Rydahl Andersen updated HHH-2639:
-------------------------------------

    Affects Version/s: 3.2.1

> HQL parser treats closing (right) parenthesis wrong
> ---------------------------------------------------
>
>                 Key: HHH-2639
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2639
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: query-hql
>    Affects Versions: 3.2.1
>         Environment: Hibernate 3.2.1 against Oracle 10g.
>            Reporter: Barak Ori
>
> The following HQL query "from Employee e where e.id > 100)" (notice the extra right parenthesis) works fine, although the parentheses are not balanced. It works as if the last parenthesis doesn't exist.
> The following HQL query also works: "from Employee e where e.id > 100)) and e.id < 1000", and returns results like the previous query.
> It looks like the first time an extra right parenthesis is found, it marks the end of the HQL query, and everything else is ignored.
> I've encountered this since I have a large piece of code that generates HQL queries dynamically. One component failed to balance parentheses properly, and the query didn't fail - instead it returned wrong results (imagine a this problematic HQL fragment as in inner query...) I think a parsing error on such queries is much nicer than accepting them and returning wrong results.

-- 
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