Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 61531
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: GAAS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.17.1
Fixed in: (no value)



Subject: t/02attribs.t fails because failed ping returns a SQLSTATE code of 22000
When I run 'perl -Mblib t/02attribs.t' here it fails with: ... ok 241 - Database handle attribute "Active" is false after disconnect ok 242 - Parent in fork test is working properly ("InactiveDestroy" = 0) ok 243 - Ping fails after the child has exited ("InactiveDestroy" = 0) not ok 244 - Failed ping returns a SQLSTATE code of 08000 # Failed test 'Failed ping returns a SQLSTATE code of 08000' # at t/02attribs.t line 1597. # got: '22000' # expected: '08000' ok 245 - pg_ping gives an error code of -2 after the child has exited ("InactiveDestroy" = 0) ok 246 - Parent in fork test is working properly ("InactiveDestroy" = 1) ok 247 - Ping works after the child has exited ("InactiveDestroy" = 1) ok 248 - Successful ping returns a SQLSTATE code of 00000 (empty string) ok 249 - Statement handle works after forking # Looks like you failed 1 test of 249. I'm using perl-5.12.2, DBD-Pg-2.17.1 with statically linked with libqt from postgresql-8.4.4 and a remote test server.
http://www.cpantesters.org/cpan/report/05864096-b19f-3f77-b713-d32bba55d77f seems to be a very similar report; but it's for DBD-Pg-2.15.1
In the SVN repo I also found -r12691 without that making me any wiser: ------------------------------------------------------------------------ r12691 | turnstep | 2009-04-13 18:56:07 -0700 (Mon, 13 Apr 2009) | 2 lines Tweak new SQLSTATE output. ------------------------------------------------------------------------ Index: t/02attribs.t ========================================================= ========== --- t/02attribs.t (revision 12690) +++ t/02attribs.t (revision 12691) @@ -1586,9 +1586,9 @@ $t=qq{Ping fails after the child has exited ("InactiveDestroy" = $destroy)}; is ( $dbh->ping(), 0, $t); - $t='Failed ping returns a SQLSTATE code of 22000'; + $t='Failed ping returns a SQLSTATE code of 08000'; my $state = $dbh->state(); - is ($state, '22000', $t); + is ($state, '08000', $t); $t=qq{pg_ping gives an error code of -2 after the child has exited ("InactiveDestroy" = $destroy)}; is ( $dbh->pg_ping(), -2,$t);
Interesting - a 08000 is returned for a libpq PGRES_FATAL_ERROR (which is what we expect), but 22000 is the default "nothing else matched" state, so I'm curious what state is actually being returned here. If possible, could anyone who can dupe this (I can't get it to fail here) modify dbdimp.c so you can see what code is being returned? I think this will do it: if (!stateset) { /* Do our best to map the status result to a sqlstate code */ + fprintf(stderr, "STATUS WAS %d\n", status);
From: jschrod [...] acm.org
DBD::PG 2.19.3, postgresql-devel 8.4.13 from RHEL6, Server is PostgreSQL 9.2. I get this error. I added the debugging print statement, output is: STATUS WAS 1 I hope this helps.
This code has been changed since the bug was opened, could you try the latest git version and see if you still get 22000?
Marking as stalled for now.
Closing as resolved, as we haven't seen any reports of this for years now.