Author: timbo Date: Sun Mar 25 07:40:13 2007 New Revision: 9329 Modified: dbi/trunk/Changes dbi/trunk/Makefile.PL dbi/trunk/lib/DBD/Gofer/Transport/pipeone.pm dbi/trunk/lib/DBD/Gofer/Transport/stream.pm dbi/trunk/lib/DBI/Gofer/Response.pm dbi/trunk/t/19fhtrace.t dbi/trunk/t/85gofer.t
Log: Make pipe and stream transport ignore wsrn from old versions of blib. Remove use of Time::HiRes. Fix warning from t/19fhtrace.t for old perls. Modified: dbi/trunk/Changes ============================================================================== --- dbi/trunk/Changes (original) +++ dbi/trunk/Changes Sun Mar 25 07:40:13 2007 @@ -6,7 +6,8 @@ =cut -Extract http transport into new distribution. +http://buildd.debian.org/fetch.cgi?&pkg=libdbi-perl&ver=1.54-1&arch=m68k&stamp=1174636818&file=log + Add attr-passthru to prepare()? Terminology for client and server ends Document user/passwd issues at the various levels of the stack Modified: dbi/trunk/Makefile.PL ============================================================================== --- dbi/trunk/Makefile.PL (original) +++ dbi/trunk/Makefile.PL Sun Mar 25 07:40:13 2007 @@ -120,7 +120,12 @@ AUTHOR => 'Tim Bunce ([email protected])', VERSION_FROM => 'DBI.pm', ABSTRACT_FROM => 'DBI.pm', - PREREQ_PM => { "Test::Simple" => 0.40, Storable => 1, "File::Spec" => 1 }, + PREREQ_PM => { + "Test::Simple" => 0.40, + "Storable" => 1, + "File::Spec" => 0, + "Scalar::Util" => 0, + }, EXE_FILES => [ "dbiproxy$ext_pl", "dbiprof$ext_pl" ], DIR => [ ], dynamic_lib => { OTHERLDFLAGS => "$::opt_g" }, Modified: dbi/trunk/lib/DBD/Gofer/Transport/pipeone.pm ============================================================================== --- dbi/trunk/lib/DBD/Gofer/Transport/pipeone.pm (original) +++ dbi/trunk/lib/DBD/Gofer/Transport/pipeone.pm Sun Mar 25 07:40:13 2007 @@ -112,8 +112,10 @@ my $response = $self->thaw_data($frozen_response); if ($stderr_msg) { - warn "STDERR message from @$cmd: $stderr_msg"; # XXX remove later - $response->add_err(0, $stderr_msg); + # add stderr messages as warnings (for PrintWarn) + $response->add_err(0, $stderr_msg, undef, $self->trace) + # but ignore warning from old version of blib + unless $stderr_msg =~ /^Using .*blib at / && "@$cmd" =~ /-Mblib/; } return $response; Modified: dbi/trunk/lib/DBD/Gofer/Transport/stream.pm ============================================================================== --- dbi/trunk/lib/DBD/Gofer/Transport/stream.pm (original) +++ dbi/trunk/lib/DBD/Gofer/Transport/stream.pm Sun Mar 25 07:40:13 2007 @@ -140,7 +140,7 @@ my $self = shift; my $connection = $self->connection_info || die; - my ($pid, $rfh, $efh) = @{$connection}{qw(pid rfh efh)}; + my ($pid, $rfh, $efh, $cmd) = @{$connection}{qw(pid rfh efh cmd)}; # blocks till a newline has been read $! = 0; @@ -172,9 +172,12 @@ # XXX need to be able to detect and deal with corruption my $response = $self->thaw_data(pack("H*",$frozen_response)); - # add any stderr messages as a warning (ie PrintWarn) - $response->add_err(0, $stderr_msg, undef, $self->trace) - if $stderr_msg; + if ($stderr_msg) { + # add stderr messages as warnings (for PrintWarn) + $response->add_err(0, $stderr_msg, undef, $self->trace) + # but ignore warning from old version of blib + unless $stderr_msg =~ /^Using .*blib at / && "@$cmd" =~ /-Mblib/; + } return $response; } Modified: dbi/trunk/lib/DBI/Gofer/Response.pm ============================================================================== --- dbi/trunk/lib/DBI/Gofer/Response.pm (original) +++ dbi/trunk/lib/DBI/Gofer/Response.pm Sun Mar 25 07:40:13 2007 @@ -9,6 +9,7 @@ use strict; +use Carp; use DBI qw(neat neat_list); use base qw(DBI::Util::_accessor); @@ -44,7 +45,8 @@ chomp $errstr if $errstr; $state ||= ''; - warn "add_err($err, $errstr, $state)" if $trace and $errstr || $err; + carp ref($self)."->add_err($err, $errstr, $state)" + if $trace and defined($err) || $errstr; my ($r_err, $r_errstr, $r_state) = ($self->{err}, $self->{errstr}, $self->{state}); Modified: dbi/trunk/t/19fhtrace.t ============================================================================== --- dbi/trunk/t/19fhtrace.t (original) +++ dbi/trunk/t/19fhtrace.t Sun Mar 25 07:40:13 2007 @@ -3,7 +3,6 @@ use strict; -# 21 tests originally use Test::More tests => 21; ## ---------------------------------------------------------------------------- @@ -206,7 +205,7 @@ SKIP: { eval { require 5.008; }; - skip "Layered I/O not available in Perl $^V" + skip "Layered I/O not available in Perl $^V", 13 if $@; ## ---------------------------------------------------------------------------- # Then use layered filehandle Modified: dbi/trunk/t/85gofer.t ============================================================================== --- dbi/trunk/t/85gofer.t (original) +++ dbi/trunk/t/85gofer.t Sun Mar 25 07:40:13 2007 @@ -6,11 +6,10 @@ use warnings; use Cwd; -use Time::HiRes qw(time); use Data::Dumper; use Test::More; -use DBI; +use DBI qw(dbi_time); if (my $ap = $ENV{DBI_AUTOPROXY}) { # limit the insanity plan skip_all => "transport+policy tests skipped with non-gofer DBI_AUTOPROXY" @@ -153,16 +152,16 @@ is_deeply($rowset, { '1' => { dKey=>1, dVal=>'apples' }, 2 => { dKey=>2, dVal=>'apples' } }); if ($perf_count and $transport ne 'pipeone') { - my $start = time(); + my $start = dbi_time(); $dbh->selectall_arrayref("SELECT dKey, dVal FROM fruit") for (1000..1000+$perf_count); - $durations{select}{"$transport+$policy_name"} = time() - $start; + $durations{select}{"$transport+$policy_name"} = dbi_time() - $start; # some rows in to get a (*very* rough) idea of overheads - $start = time(); + $start = dbi_time(); $ins_sth->execute($_, 'speed') for (1000..1000+$perf_count); - $durations{insert}{"$transport+$policy_name"} = time() - $start; + $durations{insert}{"$transport+$policy_name"} = dbi_time() - $start; } print "Testing go_request_count and caching of simple values\n";
