Author: timbo
Date: Wed Jul 5 09:03:52 2006
New Revision: 6617
Modified:
dbi/trunk/DBI.pm
dbi/trunk/t/15array.t
Log:
Fix execute_for_fetch error handling and add tests.
Modified: dbi/trunk/DBI.pm
==============================================================================
--- dbi/trunk/DBI.pm (original)
+++ dbi/trunk/DBI.pm Wed Jul 5 09:03:52 2006
@@ -1932,7 +1932,7 @@
}
}
my $tuples = @$tuple_status;
- return $sth->set_err(1, "executing $tuple_status generated $err_count
errors")
+ return $sth->set_err(1, "executing $tuples generated $err_count
errors")
if $err_count;
return scalar(@$tuple_status) || "0E0";
}
Modified: dbi/trunk/t/15array.t
==============================================================================
--- dbi/trunk/t/15array.t (original)
+++ dbi/trunk/t/15array.t Wed Jul 5 09:03:52 2006
@@ -2,7 +2,7 @@
use strict;
-use Test::More tests => 50;
+use Test::More tests => 52;
## ----------------------------------------------------------------------------
## 15array.t
@@ -45,7 +45,7 @@
# -----------------------------------------------
-ok(!$sth->execute_array(
+ok(! eval { $sth->execute_array(
{
ArrayTupleStatus => $tuple_status
},
@@ -53,9 +53,11 @@
42, # scalar 42 treated as array
of 42's
undef, # scalar undef treated as array
of undef's
[ qw(A B C) ], # array of strings
- ),
- '... execute_array should return false'
+ ) },
+ '... execute_array should return false'
);
+ok $@, 'execute_array failure with RaiseError should have died';
+like $sth->errstr, '/executing 3 generated 1 errors/';
cmp_ok(scalar @{$rows}, '==', 2, '... we should have 2 rows');
cmp_ok(scalar @{$tuple_status}, '==', 3, '... we should have 3 tuple_status');