execute_array() #2

merged 7 commits into from Oct 10, 2012


None yet

4 participants


We've recently started using DBI's execute_array() at work.

Out testing used DBD::Mock which doesn't support execute_array().

This set of commits adds the failing test, then implements execute_array() in DBD::Mock.

The testing is a bit sparse, but should be easy enough to extend as and when other users of the module require it.

Behaviour is as we (currently) expect from our test suite with this addition.

chiselwright added some commits Sep 27, 2012
@chiselwright chiselwright Add git-repo url to meta-data
This saves people hunting around github on the offchange that there's a
git-repo of the project. Now it's in the meta data and should be a lot easier
for people to find.
@chiselwright chiselwright Add failing test for execute_array()
This is something we've tried using, and hence mocking in tests at $work
This script fails with the same error we're seeing, so is a good starting
point for adding the functionality:

    $ prove -lv t/030_st_execute_array.t
    t/030_st_execute_array.t ..
    ok 1 - use DBD::Mock;
    ok 2 - use DBI;
    DBD::Mock::st execute_array failed: 3 bind values supplied but 0 expected at t/030_st_execute_array.t line 28.
    not ok 3 - Called execute_array() ok

    #   Failed test 'Called execute_array() ok'
    #   at t/030_st_execute_array.t line 30.
    # Looks like you failed 1 test of 3.
    Dubious, test returned 1 (wstat 256, 0x100)
    Failed 1/3 subtests
@chiselwright chiselwright git: ignore vi* swap files 62e4f4a
@chiselwright chiselwright execute_array(): don't test single scalar value c51ed6e
@chiselwright chiselwright execute_array(): diag any errors in test 9c5a03a
@chiselwright chiselwright Add bind_param_array() method
This seems to behave the same as bind_param() in our mocked world, so we just
pass the call on.
@chiselwright chiselwright Add execute_array() method to DBD::Mock::st
This is an early prototype that no longer dies when we call execute_array() on
a mocked $dbh - but the testing doesn't yet have very high coverage to prove
that it behaves as expected.
ginesr commented Oct 10, 2012

@bluescreen10 i'm merging this change, looks good to me!

@ginesr ginesr merged commit efc9492 into bluescreen10:master Oct 10, 2012

Thanks for the patch. I've uploaded today version 1.45 of DBD::Mock to CPAN
hopefully future fixes won't need to wait so long :D

On Tue, Oct 9, 2012 at 3:12 PM, Shlomi Fish notifications@github.comwrote:

@chiselwright https://github.com/chiselwright : see Rob Kinyon's
comment here -
http://blogs.perl.org/users/chisel/2012/10/dbdmock-still-maintained.html .

Reply to this email directly or view it on GitHubhttps://github.com/bluescreen10/dbd-mock/pull/2#issuecomment-9277165.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment