diff --git a/Changes b/Changes index bb807b9..0feb3ff 100644 --- a/Changes +++ b/Changes @@ -1,13 +1,15 @@ Revision history for Perl extension DBD::Mock. -0.27 +0.27 Mon July 11, 2005 - added NULL_RESULTSET constant - - now allowing errors to be set with mock_add_resultset - see the docs for more information. + - now allowing errors to be set with mock_add_resultset. + Support is currently experimental, see the file + 't/023_statement_failure.t' and the EXPERIMENTAL section + of the docs for more information. - added patch from Collin Winter to fix a bug in the begin_work(), commit() and rollback() methods - - added patch from for the - fetchall_hashref(), fetchrow_hashref() and + - added patch from Andrew McHarg for + the fetchall_hashref(), fetchrow_hashref() and selectcol_arrayref() methods and tests 0.26 Fri Apr 08 2005 diff --git a/lib/DBD/Mock.pm b/lib/DBD/Mock.pm index 374f226..ec1ab5b 100644 --- a/lib/DBD/Mock.pm +++ b/lib/DBD/Mock.pm @@ -1738,6 +1738,18 @@ All functionality listed here is highly experimental and should be used with gre =over 4 +=item Error handling in I + +We have added experimental erro handling in I the best example is the test file F, but it looks something like this: + + $dbh->{mock_add_resultset} = { + sql => 'SELECT foo FROM bar', + results => DBD::Mock->NULL_RESULTSET, + failure => [ 5, 'Ooops!' ], + }; + +The C<5> is the DBI error number, and C<'Ooops!'> is the error string passed to DBI. This basically allows you to force an error condition to occur when a given SQL statement is execute. We are currently working on allowing more control on the 'when' and 'where' the error happens, look for it in future releases. + =item Attribute Aliasing Basically this feature allows you to alias attributes to other attributes. So for instance, you can alias a commonly expected attribute like 'mysql_insertid' to something DBD::Mock already has like 'mock_last_insert_id'. While you can also just set 'mysql_insertid' yourself, this functionality allows it to take advantage of things like the autoincrementing of the 'mock_last_insert_id' attribute. @@ -1828,7 +1840,7 @@ L =item Thanks to Collin Winter for the patch to fix the C, C and C methods. -=item Thanks to Eamcharg@acm.orgE for C, C and C methods and tests. +=item Thanks to Andrew McHarg Eamcharg@acm.orgE for C, C and C methods and tests. =back