Bug #14360 | Date Between Interval Broken | ||
---|---|---|---|
Submitted: | 26 Oct 2005 21:58 | Modified: | 14 Apr 2006 18:22 |
Reporter: | Chris DiMartino | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S1 (Critical) |
Version: | 5.0.15 | OS: | Linux (linux) |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
[26 Oct 2005 21:58]
Chris DiMartino
[26 Oct 2005 22:08]
Jorge del Conde
Thanks for your bug report. I was able to reproduce this problem using 5.0.16bk: mysql> select * from dummy_date d1, dummy_date2 d2 where d2.test_date between -> d1.test_date - interval 2 day and d1.test_date + interval 2 day; Empty set (0.00 sec) mysql> mysql> select * from dummy_date d1 join dummy_date2 d2 on d2.test_date between -> d1.test_date - interval 3 day and d1.test_date + interval 2 day; +------------+------------+ | test_date | test_date | +------------+------------+ | 2005-10-01 | 2005-10-01 | +------------+------------+ 1 row in set (0.00 sec) mysql>
[17 Jan 2006 18:10]
Chris DiMartino
This bug is a HUGE bug and has not been touched in 2 months now, with no perspective fix in sight! Can someone please get on this?
[18 Jan 2006 13:03]
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/1263
[10 Apr 2006 13:49]
Magnus BlÄudd
Patch looks ok to me.
[10 Apr 2006 14:02]
Chad MILLER
My only complaint, a minor one, is that this patch returns integers for booleans. We have TRUE and FALSE symbols, why not use them? I dislike translating numbers to truthness. Also, note the last line of Item_date_add_interval::eq : return memcmp(&interval, &other_interval, sizeof(INTERVAL)) ? 0 : 1; Why not return memcmp(&interval, &other_interval, sizeof(INTERVAL)) == 0; ? That has an obvious true/false meaning, and that's what we're trying to convey in this equality test.
[11 Apr 2006 11:14]
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/4781
[11 Apr 2006 14:53]
Ramil Kalimullin
fixed in 5.0.21
[14 Apr 2006 18:22]
Paul DuBois
Noted in 5.0.21 changelog. For <literal>InnoDB</literal> tables, an expression of the form <literal><replaceable>col_name</replaceable> BETWEEN <replaceable>col_name2</replaceable> - INTERVAL <replaceable>x</replaceable> DAY AND <replaceable>col_name2</replaceable> + INTERVAL <replaceable>x</replaceable> DAY</literal> when used in a join returned incorrect results. (Bug #14360)