Object-Oriented Software Construction

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_DATES SQL 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


One thought on “

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s