[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1480) Support new MySQL 5.0.12 join syntax

Peter Lundberg (JIRA) noreply at atlassian.com
Tue Dec 5 12:10:05 EST 2006


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480?page=comments#action_25562 ] 

Peter Lundberg commented on HHH-1480:
-------------------------------------

This issue also exists for Hibernate 2.1.6. A potential solution is to replace the ", " cross join operator with " JOIN " and accordingly filter the resulting from clause from leading " JOIN ". We are testing this approach as a bug-fix for our system, but more work is needed to get this properly into dialects etc.

> Support new MySQL 5.0.12 join syntax
> ------------------------------------
>
>          Key: HHH-1480
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1480
>      Project: Hibernate3
>         Type: New Feature

>   Components: query-sql
>     Versions: 3.1.2
>     Reporter: trebor iksrazal

>
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
> "Beginning with MySQL 5.0.12, natural joins and joins with USING, including outer join variants, are processed according to the SQL:2003 standard. These changes make MySQL more compliant with standard SQL. However, they can result in different output columns for some joins. Also, some queries that appeared to work correctly in older versions must be rewritten to comply with the standard. The following list provides more detail about several effects of the 5.0.12 change in join processing. The term "previously" means "prior to MySQL 5.0.12."
> Using 5.0.18 and hibernate 3.1.2, hibernate is not producing the correct join syntax for the latest versions of mysql. 
> For example:
>   FROM tableA AS A, tableB AS B INNER JOIN tableC AS C ON A.field1 =
> C.field2
> The above fails, because the B JOIN C is evaluated before the A alias has
> been created.
> The solution is to use parentheses to force an order of evaluation:
>   FROM (tableA AS A, tableB AS B) INNER JOIN tableC AS C ON A.field1 =
> C.field2 

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