NOTNULL DATETIME column created without default value is incorrectly mapped to 1970-01-01
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Persephone |
Fix Committed
|
Undecided
|
Unassigned |
Bug Description
Having created a table with a DATETIME column.
CREATE TABLE IF NOT EXISTS `props` (
...
`DATETIME_VALUE` datetime NOT NULL,
...
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SELECT DATETIME_VALUE FROM `props` LIMIT 0 , 30
returns: 0000-00-00 00:00:00
Now, having declared the following in my schema file:
provider db_xyz {
var db_xyz;
type DBSource;
table props {
...
DATETIME_
}
}
entity SomeEntity {
fields {
...
Value<DateTime>;
}
}
mapper SomeEntity {
provider db_xyz;
fields {
using props {
@DATETIME_VALUE = Value;
}
}
}
$lastrun = strftime( "%Y-%m-%d %H:%M:%S", SomeEntity:
$lastrun is 1970-01-01 01:00:00, not 0000-00-00 00:00:00
Consider using: pear.php. net/package/ Date/docs/ latest/ li_Date. html
http://