I have 2 tables:
audit:
Code:
FROM_NUMBER TO_NUMBER
123 321
222 111
333 123
address_book_contact:
Code:
PHONE NAME
123 Bill
this query
Code:
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
Code:
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
Code:
123 321 Bill Bill
222 111 null null
333 123 null null
in java app using hibernate.
As you can see, b.name is substituted instead of c.name
Is this a bug?