Subject: | unsupported method: "fetchall_hashref" |
Date: | Tue, 2 Dec 2014 10:52:09 -0800 |
To: | "bug-Test-MockDBI [...] rt.cpan.org" <bug-Test-MockDBI [...] rt.cpan.org> |
From: | Boris Sitsker <Boris_Sitsker [...] symantec.com> |
If you try to use "fetchall_hashref" with mockdbi you get unsupported method
To resolve this
add this
sub _dbi_fetchall_hashref{
my ($self) = @_;
$mockdbi->_clear_dbi_err_errstr($self);
#return if we are not executed
return if( !$self->{Executed} );
my ($status, $retval) = $mockdbi->_has_fake_retval($self->{Statement});
if($status){
$mockdbi->_set_fake_dbi_err_errstr($self);
if(ref($retval) eq 'CODE'){
return $retval->($self);
}
}
#The resultset should be an array of hashes
if(ref($retval) ne 'HASH'){
#Should implement support for RaiseError and PrintError
return;
}
return $retval;
}
to "/usr/local/share/perl/5.18.2/Test/MockDBI/St.pm"
it works
Message body is not shown because it is too large.