[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3988) double left join within same column names returns wrong result

Penkov Vladimir (JIRA) noreply at atlassian.com
Wed Jun 24 05:08:33 EDT 2009


double left join within same column names returns wrong result
--------------------------------------------------------------

                 Key: HHH-3988
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3988
             Project: Hibernate Core
          Issue Type: Bug
          Components: query-sql
    Affects Versions: 3.2.4.sp1
         Environment: mysql 5.0.51b
            Reporter: Penkov Vladimir


I have 2 tables: 

audit: 
from_number to_number 
123 321 
222 111 
333 123 

address_book_contact: 
phone name 
123 Bill 

this query 
SELECT a.from_number, a.to_number, b.name, c.name FROM audit a 
LEFT JOIN address_book_contact b 
ON (a.FROM_NUMBER=b.PHONE) 
LEFT JOIN address_book_contact c 
ON (a.TO_NUMBER=c.PHONE) 


returns 
123 321 Bill null 
222 111 null null 
333 123 null Bill 
in mysql query browser  and in java app using pure jdbc

and returns 
123 321 Bill Bill 
222 111 null null 
333 123 null null 
in java app using hibernate native query

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