[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3988?page=c...
]
Penkov Vladimir commented on HHH-3988:
--------------------------------------
this is database data for the test case:
CREATE TABLE test_log (
from_number VARCHAR( 5 ) NOT NULL,
to_number VARCHAR( 5 ) NOT NULL
);
CREATE TABLE test_entries (
number VARCHAR( 5 ) NOT NULL,
name VARCHAR( 5 ) NOT NULL
);
insert into test_log values ('111', '222');
insert into test_log values ('222', '111');
insert into test_log values ('111', '123');
insert into test_log values ('123', '111');
insert into test_log values ('222', '123');
insert into test_log values ('123', '222');
insert into test_entries values ('111', 'Bill');
insert into test_entries values ('222', 'Alisa');
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
Attachments: JoinTest.java, jointest.xml
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira