Skip Menu |

This queue is for tickets about the DBD-Mock CPAN distribution.

Report information
The Basics
Id: 74508
Status: resolved
Priority: 0/
Queue: DBD-Mock

People
Owner: Nobody in particular
Requestors: FBRIERE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.41
Fixed in: (no value)



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;
On Sun Jan 29 11:51:52 2012, FBRIERE wrote: Show quoted text
> 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.
Silly me, this was already reported in #71438.
I'll resolve this issue as it's a duplicate of #71438, which has recently been resolved.