Is it just me, or does Mysql allow invalid dates to be entered into columns with date
datatype? I found some data that blew up in a perl script when doing some date
manipulation, and it turns out I have invalid dates in my database, such as June 31,
2003. Of course June never has 31 days.
Is this a known bug? honestly, this seems like a pretty basic thing to validate. Is
there a patch/fix for it?
here's a transcript of a quick test i did afterwards...june 31 enters successfully but
not june 33:
mysql> create table DateTest ( id integer(11),
-> startDate date);
Query OK, 0 rows affected (0.01 sec)
mysql> desc DateTest;
+-----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| startDate | date | YES | | NULL | |
+-----------+---------+------+-----+---------+-------+
2 rows in set (0.00 sec)
mysql> insert into DateTest values (1, '2002-06-31');
Query OK, 1 row affected (0.00 sec)
mysql> select * from DateTest;
+------+------------+
| id | startDate |
+------+------------+
| 1 | 2002-06-31 |
+------+------------+
1 row in set (0.00 sec)
----------------------------------------------------------------------
Don Vu > Madstone Theaters
85 fifth avenue, 12th floor > new york > new york > 10003
p 212.379.1545 > f 212.989.7744 > www.madstonefilms.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php