Bug #57034 | incorrect OUTER JOIN result when joined on unique key | ||
---|---|---|---|
Submitted: | 27 Sep 2010 12:00 | Modified: | 29 Jan 2011 23:13 |
Reporter: | Ole John Aske | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | 5.0.91, 5.1.50, 5.1.52, 5.5.7, 5.6.99 | OS: | Any |
Assigned to: | Ole John Aske | CPU Architecture: | Any |
[27 Sep 2010 12:00]
Ole John Aske
[27 Sep 2010 13:58]
Valeriy Kravchuk
Thank you for the bug report.
[3 Dec 2010 16:55]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/125966 3477 Ole John Aske 2010-12-03 Fix for bug#57034: incorrect OUTER JOIN result when joined on unique key. The value of 'null_value' is not valid until *after* ::store_value() or ::cmp() has been called for the Item object. Fix is to check swap order of ::store_value()/::cmp() and checking of Item::null_value. This pattern is widely used other places inside item_cmpfunc.cc
[3 Dec 2010 17:00]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/125972 3387 Ole John Aske 2010-12-03 SPJ-scan-scan: Cherry picked fix for bug#57034 into SPJ branch.
[3 Dec 2010 17:02]
Ole John Aske
Has verified that this bug is present in 5.5.7 and 5.6.99 - Updated 'Version' A real simple and obvious bug fix is available.
[3 Dec 2010 17:11]
Ole John Aske
It looks like this is a duplicate for bug#49600:
[6 Dec 2010 22:56]
Ole John Aske
This fix seems to also solve the problems reported in bug#48046 - likely a duplicate.
[20 Dec 2010 13:17]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/127305 3529 Ole John Aske 2010-12-20 Updated fix for bug#57034 'incorrect OUTER JOIN result when joined on unique key' after review: Added testcase for bug#48046 & bug#49600 which are duplicates. ............. The value of 'null_value' is not valid until *after* ::store_value() or ::cmp() has been called for the Item object. Fix is to check swap order of ::store_value()/::cmp() and checking of Item::null_value. This pattern is widely used other places inside item_cmpfunc.cc
[6 Jan 2011 15:48]
Roy Lyseng
Risk for this bug fix is considered low. The impact is potentially higher than I3, as this bug may easily go unnoticed by customers. Asking for 5.5 MRU tag.
[13 Jan 2011 8:24]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/128591 3233 Ole John Aske 2011-01-13 Fix for Bug#57034 incorrect OUTER JOIN result when joined on unique key Item_equal::val_int() checked for NULL-values by checking Item::null_value *before* the respective ::store_value() and ::cmp(Item*) metods where called. As Item::null_value is set by these metods, the value of 'null_value' is not valid until *after* ::store_value() or ::cmp() has been called for the Item object. Fix is to swap order of ::store_value()/::cmp() and checking of Item::null_value. This pattern is widely used other places inside item_cmpfunc.cc .
[13 Jan 2011 8:26]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/128592 3494 Ole John Aske 2011-01-13 [merge] Merged fix for bug#57034 from mysql-5.5 -> mysql-trunk
[13 Jan 2011 8:33]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/128594 3234 Ole John Aske 2011-01-13 Fix for Bug#57034 incorrect OUTER JOIN result when joined on unique key Item_equal::val_int() checked for NULL-values by checking Item::null_value *before* the respective ::store_value() and ::cmp(Item*) metods where called. As Item::null_value is set by these metods, the value of 'null_value' is not valid until *after* ::store_value() or ::cmp() has been called for the Item object. Fix is to swap order of ::store_value()/::cmp() and checking of Item::null_value. This pattern is widely used other places inside item_cmpfunc.cc .
[13 Jan 2011 8:34]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/128595 3495 Ole John Aske 2011-01-13 [merge] Merged fix for bug#57034 from mysql-5.5 -> mysql-trunk
[13 Jan 2011 8:35]
Bugs System
Pushed into mysql-trunk 5.6.2 (revid:ole.john.aske@oracle.com-20110113083359-1z8q0hil9y22izvl) (version source revid:ole.john.aske@oracle.com-20110113083359-1z8q0hil9y22izvl) (merge vers: 5.6.2) (pib:24)
[13 Jan 2011 8:35]
Bugs System
Pushed into mysql-5.5 5.5.9 (revid:ole.john.aske@oracle.com-20110113083330-q6jqxffv9d1syew0) (version source revid:ole.john.aske@oracle.com-20110113083330-q6jqxffv9d1syew0) (merge vers: 5.5.9) (pib:24)
[13 Jan 2011 8:36]
Ole John Aske
Pushed to mysql-5.5 and mysql-trunk
[13 Jan 2011 9:13]
Bugs System
Pushed into mysql-trunk 5.6.2 (revid:georgi.kodinov@oracle.com-20110113090847-gtvlitfthaasqezp) (version source revid:georgi.kodinov@oracle.com-20110113090847-gtvlitfthaasqezp) (merge vers: 5.6.2) (pib:24)
[14 Jan 2011 8:55]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/128700 4106 Ole John Aske 2011-01-14 Backport to mysql-5.1-telco-7.0: Fix for Bug#57034 incorrect OUTER JOIN result when joined on unique key Item_equal::val_int() checked for NULL-values by checking Item::null_value *before* the respective ::store_value() and ::cmp(Item*) metods where called. As Item::null_value is set by these metods, the value of 'null_value' is not valid until *after* ::store_value() or ::cmp() has been called for the Item object. Fix is to swap order of ::store_value()/::cmp() and checking of Item::null_value. This pattern is widely used other places inside item_cmpfunc.cc .
[14 Jan 2011 8:55]
Bugs System
Pushed into mysql-5.1-telco-7.0 5.1.51-ndb-7.0.21 (revid:ole.john.aske@oracle.com-20110114085447-lpa53iyi8klji1g4) (version source revid:ole.john.aske@oracle.com-20110114085447-lpa53iyi8klji1g4) (merge vers: 5.1.51-ndb-7.0.21) (pib:24)
[14 Jan 2011 8:57]
Ole John Aske
Fix has been cherry picked for backport to mysql-5.1-telco-7.0
[20 Jan 2011 19:50]
Paul DuBois
Noted in 5.1.51-ndb-7.0.21, 5.5.10, 5.6.2 changelogs. Outer joins on a unique key could return incorrect results.