Bug #19848 | Date arithmetic can be dangerous, data disappears | ||
---|---|---|---|
Submitted: | 16 May 2006 12:03 | Modified: | 17 May 2006 10:03 |
Reporter: | Andre Timmer | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.18 | OS: | |
Assigned to: | CPU Architecture: | Any |
[16 May 2006 12:03]
Andre Timmer
[16 May 2006 17:28]
Valeriy Kravchuk
Sorry, but this is clearly described in the manual (http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html): "Date arithmetic operations require complete dates and do not work with incomplete dates such as '2006-07-00' or badly malformed dates: mysql> SELECT DATE_ADD('2006-07-00', INTERVAL 1 DAY); -> NULL mysql> SELECT '2005-03-32' + INTERVAL 1 MONTH; -> NULL " So, it is not a bug.
[17 May 2006 10:03]
Andre Timmer
You are totally right. So whenever someone wants to do date arithmetic he or she has to start a complete investigation of the data in the date columns is used?! If not the small price to pay is loss of data. Having that said i know that the real solutions of course is to have MySQL run in a mode that doesn't allow this kind of data to be entered.