Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Exception-Class-DBI CPAN distribution.

Report information
The Basics
Id: 30230
Status: resolved
Priority: 0/
Queue: Exception-Class-DBI

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc: TIMB [...] cpan.org
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.95
  • 0.01
  • 0.02
  • 0.90
  • 0.91
  • 0.92
  • 0.93
  • 0.94
Fixed in: 0.96



CC: TIMB [...] cpan.org
Subject: DBI 1.601 breaks Exception::Class::DBI
I don't know whose bug it is, so I report it under E:C:D and try to CC Tim. Since 1.601 I see the following test failure t/dbh......... # Failed test 'Check err' # at t/dbh.t line 35. # got: '2000000000' # expected: '1' # Looks like you failed 1 test of 28. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 8 Failed 1/28 tests, 96.43% okay Downgrading to DBI-1.59 solves the problem.
CC: Tim Bunce <TIMB [...] cpan.org>
Subject: Re: [rt.cpan.org #30230] DBI 1.601 breaks Exception::Class::DBI
Date: Wed, 24 Oct 2007 10:07:39 -0700
To: bug-Exception-Class-DBI [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Oct 23, 2007, at 20:09, Andreas Koenig via RT wrote: Show quoted text
> # Failed test 'Check err' > # at t/dbh.t line 35. > # got: '2000000000' > # expected: '1' > # Looks like you failed 1 test of 28.
Well, if I change the expectation to '2000000000', the tests pass. Tim, were the error codes changed in 1.601, perhaps just in the ExampleP:dummy driver? I dont't see anything about that in the Changes file. The code in question is: eval { $dbh->do('select foo from foo'); }; is( $err->err, '2000000000', "Check err" ); is( $err->errstr, 'Unknown field names: foo', "Check errstr" ); is( $err->error, 'DBD::ExampleP::db do failed: Unknown field names: foo', "Check error" ); Thanks, David
CC: ANDK [...] cpan.org, TIMB [...] cpan.org
Subject: Re: [rt.cpan.org #30230] DBI 1.601 breaks Exception::Class::DBI
Date: Wed, 24 Oct 2007 22:46:53 +0100
To: David Wheeler via RT <bug-Exception-Class-DBI [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Wed, Oct 24, 2007 at 01:08:31PM -0400, David Wheeler via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=30230 > > > On Oct 23, 2007, at 20:09, Andreas Koenig via RT wrote: >
> > # Failed test 'Check err' > > # at t/dbh.t line 35. > > # got: '2000000000' > > # expected: '1' > > # Looks like you failed 1 test of 28.
Darn. I forgot to document that. >>TODO Basically you could expect $DBI::stderr || 1; Sorry for the hassle. Tim.
CC: Tim Bunce <TIMB [...] cpan.org>
Subject: Re: [rt.cpan.org #30230] DBI 1.601 breaks Exception::Class::DBI
Date: Wed, 24 Oct 2007 17:30:17 -0700
To: bug-Exception-Class-DBI [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Oct 24, 2007, at 14:47, Tim Bunce via RT wrote: Show quoted text
>>> # Failed test 'Check err' >>> # at t/dbh.t line 35. >>> # got: '2000000000' >>> # expected: '1' >>> # Looks like you failed 1 test of 28.
> > Darn. I forgot to document that. >>TODO > > Basically you could expect > > $DBI::stderr || 1;
So is 2000000000 correct for $DBI::err? Show quoted text
> Sorry for the hassle.
No worries. Best, David
CC: ANDK [...] cpan.org, TIMB [...] cpan.org
Subject: Re: [rt.cpan.org #30230] DBI 1.601 breaks Exception::Class::DBI
Date: Thu, 25 Oct 2007 09:42:38 +0100
To: David Wheeler via RT <bug-Exception-Class-DBI [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
On Wed, Oct 24, 2007 at 08:30:55PM -0400, David Wheeler via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=30230 > > > On Oct 24, 2007, at 14:47, Tim Bunce via RT wrote: >
> >>> # Failed test 'Check err' > >>> # at t/dbh.t line 35. > >>> # got: '2000000000' > >>> # expected: '1' > >>> # Looks like you failed 1 test of 28.
> > > > Darn. I forgot to document that. >>TODO > > > > Basically you could expect > > > > $DBI::stderr || 1;
Or probabbly better to just expect a tru value. Show quoted text
> So is 2000000000 correct for $DBI::err?
The DBI and most of the drivers it supplies used to use the value 1 as a standard generic error code. But for 'plumbing' drivers like DBD::Proxy and DBD::Gofer it meant you couldn't easily distinguish between error codes from the top level local driver vs error codes from the underlying driver. So now instead of 1 then use $DBI::stderr, which is initialised like this: $DBI::stderr = 2_000_000_000; # a very round number below 2**31 Returning to your question... I recommend either expecting any true value, or expect $DBI::stderr || 1 so it'll work for both old and new DBI versions. Tim.
CC: Tim Bunce <TIMB [...] cpan.org>
Subject: Re: [rt.cpan.org #30230] DBI 1.601 breaks Exception::Class::DBI
Date: Thu, 25 Oct 2007 09:51:04 -0700
To: bug-Exception-Class-DBI [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Oct 25, 2007, at 01:43, Tim Bunce via RT wrote: Show quoted text
> Or probabbly better to just expect a tru value. >
>> So is 2000000000 correct for $DBI::err?
> > The DBI and most of the drivers it supplies used to use the value 1 > as a > standard generic error code. > > But for 'plumbing' drivers like DBD::Proxy and DBD::Gofer it meant you > couldn't easily distinguish between error codes from the top level > local driver vs error codes from the underlying driver. > > So now instead of 1 then use $DBI::stderr, which is initialised > like this: > > $DBI::stderr = 2_000_000_000; # a very round number below 2**31 > > Returning to your question... I recommend either expecting any true > value, or expect > > $DBI::stderr || 1 > > so it'll work for both old and new DBI versions.
Thanks. ARe $DBI::err and $DBI::stderr the same? Best, David
CC: bug-Exception-Class-DBI [...] rt.cpan.org
Subject: Re: [rt.cpan.org #30230] DBI 1.601 breaks Exception::Class::DBI
Date: Fri, 26 Oct 2007 11:59:21 -0700
To: Tim Bunce <Tim.Bunce [...] pobox.com>
From: "David E. Wheeler" <david [...] kineticode.com>
On Oct 26, 2007, at 02:07, Tim Bunce wrote: Show quoted text
>>> so it'll work for both old and new DBI versions.
>> >> Thanks. ARe $DBI::err and $DBI::stderr the same?
> > No. Reread the above. $DBI::stderr is a 'constant' (though can be > changed).
Sorry, I got confused because I was thinking that $DBI::stderr was a new value set on error like $DBI::err is set. It took me a few minutes (and an attempt to call the nonexistent $dbh->stderr) to realize that you just meant that $dbh->err now defaults to the value set in $DBH::stderr. So the latter is not a code set on error, but the standard code with which to set err on error. Correct? At any rate, I've changed the test to: is( $err->err, $DBI::stderr || 1, "Check err" ); New version shortly. Thanks, David