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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|