Now, looking at your actual output, I see that indeed, date_time cannot be NULL because you order by it. So it must be a bug or a problem with either DBIx::Class or your database driver. I don't know if it's easy to get at the unsullied result set as returned by DBI, but maybe you can determine the culprit by doing:
my $dbh = DBI->connect(..., {RaiseError => 1});
my $sth = $dbh->prepare(<<SQL);
SELECT me.id, me.name, me.date_time, me.status_code, me.time_taken
+
FROM tests me
WHERE ( ( ( date_time <= ? AND date_time >= ? ) AND name = ? ) )
ORDER BY date_time
SQL
$sth->execute('2009-06-24 23:59:59', '2009-06-24 00:00:00', 'ART_CRV')
+;
my $res = $sth->fetchall_arrayref();
print Dumper($res);
If you find any undef in there, the problem is with your DBD. If you don't find any undef there, the problem is likely in your DBIx::Class stack somewhere. |