Bug #1717 | INNER JOIN on multiple derived tables(subqueries) not returning all rows | ||
---|---|---|---|
Submitted: | 30 Oct 2003 15:32 | Modified: | 5 Dec 2003 6:17 |
Reporter: | Daniel Wrenn | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 4.1.0 | OS: | Windows (Windows 2000) |
Assigned to: | CPU Architecture: | Any |
[30 Oct 2003 15:32]
Daniel Wrenn
[30 Oct 2003 15:54]
Daniel Wrenn
Just realized that it is grouping and summing the data in the table A so to update my scenerio the committed amount is 18. This may then be a duplicate bug... table A id | committed ----------- 1 | 5 2 | 6 3 | 7 table B id | obligated ----------- 1 | 2 2 | 3 3 | 4 table C id | disbursed ----------- 1 | 8 2 | 9 3 | 0 When I now use an INNER JOIN to join them together on id this is what I get: id | committed | obligated | disbursed -------------------------------------- 2 | 18 | 3 | 9 if I do a LEFT JOIN I get this: id | committed | obligated | disbursed -------------------------------------- 1 | null | 2 | 8 2 | 18 | 3 | 9 3 | null | 4 | 0 I expect this: id | committed | obligated | disbursed -------------------------------------- 1 | 5 | 2 | 8 2 | 6 | 3 | 9 3 | 7 | 4 | 0
[30 Oct 2003 16:05]
Daniel Wrenn
I have this type of SQL all over the place, and am creating a MySQL library in addition to the Oracle library for our app. I will need it in a couple weeks, do I have any hope of version 4.1.1 with a fix or should I implement a workaround?
[30 Oct 2003 17:39]
Dean Ellis
You are very probably experiencing an issue that has already been corrected in 4.1.1. (I have queries structured quite like yours which work fine.) If you would like to test your specific scenario against 4.1.1 and do not have the capability to compile it yourself from the development source tree, submit a specific and complete test case and it will be tested against the latest sources to see if there are outstanding bugs. A binary release of 4.1.1 should hopefully come fairly soon, but I cannot be more specific than that. Thank you
[4 Dec 2003 17:15]
Daniel Wrenn
Downloaded 4.1.1 and the bug I submitted is now fixed, so you can close this bug.
[5 Dec 2003 6:17]
Dean Ellis
Alright, thank you for the update.