[MDEV-454] Addition of a time interval reduces the resulting value Created: 2012-08-15 Updated: 2012-08-30 Resolved: 2012-08-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.25 |
| Fix Version/s: | 5.5.27, 5.3.9 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Elena Stepanova | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I presume it affects 5.3 too, but I didn't check. The issue comes from the fact that date and datetime values like '2012-00-00' are vaguely supported (on one hand, MySQL docs say that ranges for month and day are 1..12 and 1..31, respectively; on the other hand, it only mentions that zero values for month and day are invalid for TIMESTAMP, but doesn't say anything for DATE/DATETIME). So, this works, no errors or warnings:
Comparison works too:
Now, we add 1 day to the value. Again, no warnings or errors:
But the result is not what someone would expect:
In MySQL (5.6, did not try earlier) it is also not perfect: adddate turns the value to NULL, again without a warning. But it seems somewhat less strange than reducing it. |