Subject: | fetchrow_hashref() no longer returns session results |
The fix for rt44591, introduced in 1.41, no longer sets column names in
session result sets, thus breaking fetchrow_hashref() and related
methods and attributes.
Output of attached script under 1.39:
$VAR1 = {
'answer' => 42
};
Output under 1.41:
$VAR1 = {};
This is due to verify_statement() (which sets mock_add_resultset) now
being called during execute(), while other attributes are still set much
earlier within prepare().
Subject: | bug.pl |
use DBI;
use Data::Dumper;
my $dbh = DBI->connect('DBI:Mock:', '', '')
or die "Cannot create handle: $DBI::errstr\n";
$dbh->{mock_session} = new DBD::Mock::Session (
'foo' => (
{
statement => 'SELECT * FROM life',
results => [ ['answer'], [42] ],
}
)
);
my $row = $dbh->selectrow_hashref("SELECT * FROM life");
print Dumper $row;