Author: timbo
Date: Tue Feb 24 14:45:40 2009
New Revision: 12537

Modified:
   dbi/trunk/dbixs_rev.h
   dbi/trunk/test.pl

Log:
Update DBIXS_REVISION
Tweak test.pl


Modified: dbi/trunk/dbixs_rev.h
==============================================================================
--- dbi/trunk/dbixs_rev.h       (original)
+++ dbi/trunk/dbixs_rev.h       Tue Feb 24 14:45:40 2009
@@ -1,4 +1,4 @@
-/* Wed May 28 05:58:17 2008 */
-/* Mixed revision working copy (11334M:11336) */
+/* Thu Sep 11 17:32:48 2008 */
+/* Mixed revision working copy (11611M:11719) */
 /* Code modified since last checkin */
-#define DBIXS_REVISION 11334
+#define DBIXS_REVISION 11611

Modified: dbi/trunk/test.pl
==============================================================================
--- dbi/trunk/test.pl   (original)
+++ dbi/trunk/test.pl   Tue Feb 24 14:45:40 2009
@@ -41,7 +41,7 @@
 $::opt_n = 0;          # counter for other options
 
 GetOptions(qw(d=i h=i l=s m=i t=i n=i))
-    or die "Usage: $0 [-d n] [-h n] [-m] [-t n] [-n n] [drivername]\n";
+    or die "Usage: $0 [-d n] [-h n] [-m n] [-t n] [-n n] [drivername]\n";
 
 my $count = 0;
 my $ps = (-d '/proc') ? "ps -lp " : "ps -l";
@@ -58,7 +58,7 @@
 print "Available Drivers: ",join(", ",DBI->available_drivers(1)),"\n";
 
 
-my $dbh = DBI->connect("dbi:$driver:", '', '') or die;
+my $dbh = DBI->connect("dbi:$driver:", '', '', { RaiseError=>1 }) or die;
 $dbh->trace($::opt_h);
 
 if (0) {
@@ -78,10 +78,13 @@
     #$dbh->trace(9);
     my $level = $::opt_m;
     my $cnt = $::opt_n || 10000;
+
     print "Using $driver, same dbh...\n";
     for (my $i=0; $i<$cnt; ++$i) { mem_test($dbh, undef, $level, undef, undef, 
undef) }
+
     print "Using NullP, reconnecting each time...\n";
     for (my $i=0; $i<$cnt; ++$i) { mem_test(undef, ['dbi:NullP:'], $level, 
undef, undef, undef) }
+
     print "Using ExampleP, reconnecting each time...\n";
     my $r_develleak = 0;
     mem_test(undef, ['dbi:NullP:'], $level, undef, undef, \$r_develleak) while 
1;
@@ -134,10 +137,13 @@
 
     # this can be used to force a 'leak' to check memory use reporting
     #$main::leak .= " " x 1000;
-    system("echo $count; $ps$$") if (($count++ % 500) == 0);
+    system("echo $count; $ps$$") if (($count++ % 2000) == 0);
 
-    my $dbh = $orig_dbh || DBI->connect(@$connect);
-    $dbh->{RaiseError} = 1;
+    my $dbh = $orig_dbh || do {
+        my ($dsn, $u, $p, $attr) = @$connect;
+        $attr->{RaiseError} = 1;
+        DBI->connect($dsn, $u, $p, $attr);
+    };
     my $cursor_a;
 
     my ($dl_count, $dl_handle);
@@ -146,10 +152,11 @@
         $dl_count = Devel::Leak::NoteSV($dl_handle);
     }
 
+    my $rows;
     $cursor_a = $dbh->prepare($select)         if $level >= 2;
     $cursor_a->execute(@$params)               if $level >= 3;
     $cursor_a->fetchrow_hashref()              if $level >= 4;
-    my $rows = $cursor_a->fetchall_arrayref({})        if $level >= 4;
+    $rows = $cursor_a->fetchall_arrayref({})   if $level >= 4;
     $cursor_a->finish if $cursor_a && $cursor_a->{Active};
     undef $cursor_a;
 

Reply via email to