Hi,
     I have been looking into upgrading our mysql servers from mysql 4.0 to 
4.1 and came across this useful bit of information:

`Incompatible change: TIMESTAMP is returned as a string in 'YYYY-MM-DD 
HH:MM:SS' format (from 4.0.12 the --new option can be used to make a 4.0 
server behave as 4.1 in this respect). See Section 11.3.1.2, âTIMESTAMP 
Properties as of MySQL 4.1â.` at 
http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html

This causes parse_timestamp in DateTime::Format::MySQL to error with `Invalid 
date format: <date>`. I could fix my code to use parse_datetime instead of 
parse_timestamp but that doesnt seem right so Ive made a patch where Ive 
basically copied the parse_datetime rule into the parse_timestamp rules 
making it work with MySQL 4 and 4.1 rules. I have attached a diff, anychance 
of this getting into the DateTime::Format::MySQL distribution ??.

Thanks

Mike Bissett
Developer - HomeScreen Entertainment
-- 
In life - I have no religion,  besides the heavy metal gods
wear nothing but black skin tight leather, My skin's clad with Metal studs
Am I a wannabe? - have I no dignity. I give up all my life to be..
In the book of heavy metal.. metal!
--- MySQL.pm	2005-03-30 15:23:34.000000000 +1000
+++ MySQL.pm	2005-03-30 15:30:49.135355920 +1000
@@ -26,6 +26,11 @@
             regex  => qr/^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,
             extra  => { time_zone => 'floating' },
           },
+          { 
+            params => [ qw( year month day hour minute second ) ],
+            regex  => qr/^(\d{1,4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/,
+            extra  => { time_zone => 'floating'},
+          },
           { length => 12,
             params => [ qw( year month day hour minute second ) ],
             regex  => qr/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,

Reply via email to