[Hibernate-JIRA] Created: (HHH-3511) Sybase - Column alias in subselect doesn't works
by Juraci Paixao Krohling (JIRA)
Sybase - Column alias in subselect doesn't works
------------------------------------------------
Key: HHH-3511
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3511
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.2.4.sp1
Environment: Branch_3_2_4_SP1_CP with Sybase 15
Reporter: Juraci Paixao Krohling
I could not find any reference in documentation to support it, but it seems that column aliasing in sub-selects isn't supported. I could not find any information in the docs which confirms or denies this, but running the test CriteriaQueryTest#testDetachedCriteriaAsSubQuery can confirm this.
Hibernate generates a query which ends in:
where ? in (select this_.courseCode as y0_ from Course this_ where this_.description like ?)
This fails in Sybase, with this message:
15:29:38,063 WARN JDBCExceptionReporter:77 - SQL Error: 156, SQLState: ZZZZZ
15:29:38,074 ERROR JDBCExceptionReporter:78 - Incorrect syntax near the keyword 'AS'.
Removing all "as" keywords returns the same message, even though the query itself doesn't have it. [1]
Removing the "as $alias" solves the problem.
The working line is:
where courseCode in (select this_.courseCode from Course this_ where this_.description like 'test%')
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 11 months
[Hibernate-JIRA] Commented: (HHH-530) Allow application of filters on subqueries
by Heiko Burchard (JIRA)
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-530?page=co... ]
Heiko Burchard commented on HHH-530:
------------------------------------
Did someone have a look at the unit test I provided? If this is holds to be a bug, shouldn't this issue be reopened? Or should it be a new one? Or is this handled with the SQL Generation rewrite?
> Allow application of filters on subqueries
> ------------------------------------------
>
> Key: HHH-530
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-530
> Project: Hibernate Core
> Issue Type: Patch
> Components: core
> Reporter: Gavin King
> Assignee: Steve Ebersole
> Fix For: 3.2.x, 3.3.x, 3.4
>
> Attachments: HHH-530.3.3.SP1.patch, HHH-530.3.3.SP1.take2.patch, HHH-530.Additional.Subquery.patch, HHH-530.patch, hibernate_filter_fix-3.0.5.patch, hibernate_filter_fix-3.0.5_14.patch, HqlSqlWalker-branch32.patch, HqlWithFiltersTest.patch, SubqueriesWithFiltersTest.patch
>
>
> Currently filter conditions are applied in subselects, they should not be.
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 11 months