Skip Menu |

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

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

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

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 3.14.1



Subject: Odd warning at script exit
I'm seeing this warning in some test code that uses DBD::Pg Use of uninitialized value $DBD::Pg::VERSION in concatenation (.) or string at /home/autarch/perl5/perlbrew/perls/perl- 5.16.1/lib/site_perl/5.16.1/x86_64-linux/DBD/Pg.pm line 113 during global destruction I have no idea why this is happening.
Show quoted text
> Use of uninitialized value $DBD::Pg::VERSION in concatenation (.)
Strange. None of our $VERSION setting code looks out of place. Does this happen with any other modules? Is it just with perlbrew?
CC: DROLSKY [...] cpan.org
Subject: Re: [rt.cpan.org #83057] Odd warning at script exit
Date: Tue, 12 Feb 2013 10:06:05 -0600 (CST)
To: Greg Sabino Mullane via RT <bug-DBD-Pg [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Fri, 8 Feb 2013, Greg Sabino Mullane via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=83057 > >
>> Use of uninitialized value $DBD::Pg::VERSION in concatenation (.)
> > Strange. None of our $VERSION setting code looks out of place. Does this > happen with any other modules? Is it just with perlbrew?
It's only happening with DBD::Pg. I really only have a perlbrew perl to test with. The system Perl doesn't have the right modules installed to run the code which makes this warning show up. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
I tried perlbrew 5.16.1 but cannot duplicate the error. Can you possibly create a small script that shows the error on your system?
CC: DROLSKY [...] cpan.org
Subject: Re: [rt.cpan.org #83057] Odd warning at script exit
Date: Thu, 4 Jul 2013 15:41:55 -0500 (CDT)
To: Greg Sabino Mullane via RT <bug-DBD-Pg [...] rt.cpan.org>
From: Dave Rolsky <autarch [...] urth.org>
On Mon, 1 Jul 2013, Greg Sabino Mullane via RT wrote: Show quoted text
> I tried perlbrew 5.16.1 but cannot duplicate the error. Can you possibly create a small script that shows the error on your system?
I don't know if I can come up with a small script for this. Feel free to mark it stalled. If I have a chance to get back to this at work I'll re-open it with more details. -dave /*============================================================ http://VegGuide.org http://blog.urth.org Your guide to all that's veg House Absolute(ly Pointless) ============================================================*/
Closing this - still have not been able to reproduce, and it's been over five years now.
Subject: Re: [rt.cpan.org #83057] Odd warning at script exit
Date: Sat, 08 Aug 2020 16:28:14 +0900
To: bug-DBD-Pg [...] rt.cpan.org
From: maya <maya [...] negeta.com>
Hi, I faced same error in my script. Error message in Apache error_log: Use of uninitialized value $DBD::Pg::VERSION in concatenation (.) or string at /usr/lib64/perl5/vendor_perl/DBD/Pg.pm line 113, <HTML> line 535 during global destruction /path/to/xxxxx.pl Is this issue caused by DBD::Pg? or by CGI::Session? Environment: CentOS 8 perl-interpreter-5.26.3-416.el8.x86_64, perl-DBI-1.641-3.module_el8.1.0+199+8f0a6bbd.x86_64, perl-DBD-Pg-3.7.4-4.module_el8.1.0+268+81255909.x86_64, perl-CGI-4.38-2.el8.noarch, perl-CGI-Session-4.48-11.fc28.noarch and CentOS 6 perl-5.10.1-144.el6.x86_64, perl-DBI-1.609-4.el6.x86_64, perl-DBD-Pg-2.15.1-4.el6_3.x86_64, perl-CGI-3.51-144.el6.x86_64, perl-CGI-Session-4.35-6.el6.noarch Reproduce script: #!/usr/bin/perl use CGI; use CGI::Session; use CGI::Session::Driver::DBI; my $dsn = 'dbi:Pg:dbname=database_name;host=localhost;'; my $usr = 'user_name'; my $pwd = 'password'; my $session_timeout = '+10m'; my $http_charset = 'UTF-8'; my $cgi, $session; $cgi = new CGI; my $sid = $cgi->cookie('CGISESSID')||$cgi->param('CGISESSID')||undef; # CREATE TABLE tbl_session ( # session_id CHAR(32) NOT NULL PRIMARY KEY, # a_session TEXT # ); $session = CGI::Session->new('driver:PostgreSQL',$sid,{DataSource=>$dsn, User=>$usr, Password=>$pwd, TableName=>'tbl_session' IdColName=>'session_id'}); my $cookie = $cgi->cookie(-name => 'CGISESSID', -value => $session->id, -expires => $session_timeout); print $cgi->header(-cookie => $cookie, -charset => $http_charset); print "session->id:".$session->id."\n"; Thanks,
Thanks for the sample script: I was able to duplicate and write a workaround. Still not sure exactly *why* it is happening (and why DBD::Oracle does not suffer the same issue), but the warning should go away as of 1ac932647999af4d7188382565e5cd4d9a075b4d
Subject: Re: [rt.cpan.org #83057] Odd warning at script exit
Date: Mon, 10 Aug 2020 20:28:53 +0900
To: bug-DBD-Pg [...] rt.cpan.org
From: maya <maya [...] negeta.com>
I confirmed that the error does not occur with your patch. Thank you.