Just stumbled across some details of MySQL that might be the beginning of a neat discussion between DB and O-O guys. Handling date and time correctly at application-level can be hard enough, but it is more fun when the DBMS applies its own special quirks :-). Cited from the MySQL 5.1 reference documentation, Ch. 11.3. (Date and Time Types):
You can get MySQL to accept certain dates, such as
'1999-11-31', by using the
ALLOW_INVALID_DATESSQL mode. This is useful when you want to store a “possibly wrong” value which the user has specified (for example, in a web form) in the database for future processing. Under this mode, MySQL verifies only that the month is in the range from 0 to 12 and that the day is in the range from 0 to 31.
I think this special mode would probably outsmart most developers extending or maintaing an…
View original post 854 more words