Subject: | Parsing undefined TIMESTAMPs fails |
Using MySQL 4.1 and DateTime::Format::MySQL causes parse_datetime to fail when processing undefined TIMESTAMP fields. The attached script reproduces this error.
The error returned is:
The 'month' parameter ("00") to DateTime::new did not pass the 'is between 1 and 12' callback
at /usr/local/lib/perl5/site_perl/5.8.5/DateTime/Format/Builder/Parser/Regex.pm line 135
After running this script, the database contains something like:
+---------------------+---------------------+
| first | second |
+---------------------+---------------------+
| 2004-09-09 10:12:54 | 0000-00-00 00:00:00 |
+---------------------+---------------------+
The problem occurs because DateTime does not recognise the zeros in the 'second' field as a valid date.
This occurs on FreeBSD-5.2.1 with Perl 5.8.5 and MySQL 4.1.3-beta. Let me know if you need more information.
Thanks,
Tom
Message body not shown because it is not plain text.