CC: | Michael Petnuch <michael [...] petnuch.com> |
Subject: | BUG: Autoinflate of timestamps broken when using MySQL >= 4.1 |
Date: | Mon, 24 Jul 2006 10:35:15 -0400 |
To: | bug-Class-DBI-mysql [...] rt.cpan.org |
From: | Michael Petnuch <michael [...] petnuch.com> |
Hello,
Class::DBI::mysql tries to autoinflate a 'timestamp' column type by
using from_mysql_timestamp (from the libtime-piece-mysql-perl library).
However, as noted in the time-piece-mysql library, as of MySQL 4.1,
timestamps are returned as datetime strings.
The error occours on line 106 of mysql.pm:
$args{inflate} = "from_mysql_$type";
$args{deflate} = "mysql_$type";
It should read something like this:
# MySQL 4.1 and above need this
if(MYSQL_VERSION >= 4.1) { # Pseudocode - since I don't know
# how to check for the version of MySQL
$type = 'datetime' if($type eq 'timestamp');
}
$args{inflate} = "from_mysql_$type";
$args{deflate} = "mysql_$type";
Regards,
Michael Petnuch
Message body not shown because it is not plain text.