Skip Menu |

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

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

People
Owner: DICHI [...] cpan.org
Requestors: zigorou [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.39
Fixed in: (no value)



Subject: second prepare call before execute by first prepare will be die using DBD::Mock::Session
At first, please see test. ---- use Test::More; use DBI; plan tests => 4; my $dbr = DBI->install_driver('Mock'); isa_ok($dbr, 'DBI::dr'); my $dbh = DBI->connect('dbi:Mock:', '', ''); isa_ok($dbh, 'DBI::db'); $dbh->{mock_session} = DBD::Mock::Session->new( +{ statement => q|SELECT foo_id FROM foo|, results => [ [qw/foo_id/], [], ] }, +{ statement => q|SELECT bar_id FROM bar|, results => [ [qw/bar_id/], [], ] }, ); my $sth_one = $dbh->prepare('SELECT foo_id FROM foo'); isa_ok($sth_one, 'DBI::st'); note($sth_one->{Statement}); # $dbh->{mock_session}->{state_index}++; my $sth_two = $dbh->prepare('SELECT bar_id FROM bar'); # $dbh->{mock_session}->{state_index}--; isa_ok($sth_two, 'DBI::st'); ---- This test is not success. I wonder if I should use DBD::Mock::Session or not when the case like?
Maybe this is late but will be fixed in version 1.40 to be released reall soon
Fixed in version 1.41