[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2691) Insert Into Select command outputs incorrect exception

John Aylward (JIRA) noreply at atlassian.com
Tue Aug 10 10:00:40 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38022#action_38022 ] 

John Aylward commented on HHH-2691:
-----------------------------------

I've verified this with lots of simple test cases, and I don't think this is limited to sub select clauses. The problem seems to originate in an invalid count of closing ")". Any query where there is an extra ")" will cause the HQL parser to treat that as the end of a statement.

some examples:

SELECT t.col1 FROM Table t WHERE 1=1) ORDER BY t.col1

the ORDER BY will not be parsed an will be dropped from the query with no error.

> Insert Into Select command outputs incorrect exception
> ------------------------------------------------------
>
>                 Key: HHH-2691
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2691
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-hql
>    Affects Versions: 3.2.4.sp1
>         Environment: Hibernate 3.2.4.sp1 with Annotations 3.3.0 And Validator 3.0.0
> MySQL 5.0.42
>            Reporter: John Aylward
>            Assignee: Steve Ebersole
>         Attachments: HHH_2691.hbm.xml, HHH_2691_Test.java
>
>
> receive following exception:
> org.hibernate.QueryException: number of select types did not match those for insert [INSERT INTO ProviderInvoiceLineItem (amount,billingAccount,circuit,description,invoice,type) SELECT pili.amount,pili.billingAccount,pili.circuit,pili.description,:newInvoice,pili.type) FROM com.cicat.bedrock.billing.model.ProviderInvoiceLineItem pili WHERE pili.invoice = :oldInvoice]
> exception should be that token ')' is not excepected near "pili.type"
> Should not have gotten as far as it did, should have blown up on parsing the HQL

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