Why does MySQL accept fake date?

2006-08-26 Thread Mark
Dear MySQL-ers, Using MySQL 4.1.20, in the function DAYOFWEEK(), why does MySQL accept a bogus date like '2006-02-30'? It says the 30th of February (yeah, right) starts on a the 5th day. I was going to use this to create a table of how many days there are in each month, but that's completely

Re: Why does MySQL accept fake date?

2006-08-26 Thread Rocco
Hello Mark, in Versions of MySQL prior to 5.0.2 it is only checked that the year-part ranges from 1000-, the month-part from 1-12 and the day-part ranges from 1-31 within the date column. With 5.0.2 of MySQL the Dates must be legal, so 2006-02-31 is no more possible by default. You can

RE: Why does MySQL accept fake date?

2006-08-26 Thread Mark
Hello Rocco, Thank you for your reply. Clear and simple. :) I couldn't upgrade the MySQL server on my production server just yet, but I upgraded the local test MySQL server on a Windoze machine. And it worked like a charm. :) I just needed to create a one-time table of how many days there are