Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 66687
Status: rejected
Priority: 0/
Queue: DBD-Oracle

People
Owner: Nobody in particular
Requestors: derek.middleton [...] schwab.com
Cc:
AdminCc:

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



Subject: Connecting locally causes system() return codes to always be -1
When connecting without specifying an SID in the connection string causes subsequent system() function calls to always return -1. The database connection is successful and the commands inside the system calls execute successfully, but return value from the system() call is always -1. Script to reproduce the behavior: #!/usr/bin/perl use strict; use DBI; use DBD::Oracle; # only referenced to display version print "DBI::VERSION: " . $DBI::VERSION . "\n"; print "DBD::Oracle::VERSION: " . $DBD::Oracle::VERSION . "\n"; my $rc; $rc = system("/bin/true"); print "RC = $rc\n"; my $dbh = DBI->connect("dbi:Oracle:", "username", "password"); $dbh->disconnect; $rc = system("/bin/true"); print "RC = $rc\n"; This produces the output: DBI::VERSION: 1.616 DBD::Oracle::VERSION: 1.27 RC = 0 RC = -1 Details about my environment: cat /etc/redhat-release: Red Hat Enterprise Linux Server release 5.4 (Tikanga) uname -a: Linux hostname 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:27:37 EST 2009 x86_64 x86_64 x86_64 GNU/Linux perl -v: This is perl, v5.8.8 built for x86_64-linux-thread-multi sqlplus: SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 17 13:23:50 2011 ... This behavior doesn't happen when I specify the SID as part of the connection string e.g., 'dbi:Oracle:mysid'.
On Thu Mar 17 13:37:31 2011, derekschwab wrote: Show quoted text
> When connecting without specifying an SID in the connection string > causes subsequent system() function calls to always return -1. The > database connection is successful and the commands inside the system > calls execute successfully, but return value from the system() call is > always -1. > > Script to reproduce the behavior: > > #!/usr/bin/perl > > use strict; > use DBI; > use DBD::Oracle; # only referenced to display version > > print "DBI::VERSION: " . $DBI::VERSION . "\n"; > print "DBD::Oracle::VERSION: " . $DBD::Oracle::VERSION . "\n"; > > my $rc; > > $rc = system("/bin/true"); > print "RC = $rc\n"; > my $dbh = DBI->connect("dbi:Oracle:", "username", "password"); > $dbh->disconnect; > $rc = system("/bin/true"); > print "RC = $rc\n"; > > This produces the output: > > DBI::VERSION: 1.616 > DBD::Oracle::VERSION: 1.27 > RC = 0 > RC = -1 > > Details about my environment: > > cat /etc/redhat-release: > Red Hat Enterprise Linux Server release 5.4 (Tikanga) > > uname -a: > Linux hostname 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:27:37 EST > 2009 x86_64 x86_64 x86_64 GNU/Linux > > perl -v: > This is perl, v5.8.8 built for x86_64-linux-thread-multi > > sqlplus: > SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 17 13:23:50 2011 > ... > > This behavior doesn't happen when I specify the SID as part of the > connection string e.g., 'dbi:Oracle:mysid'.
This is a known issue with the Oracle client libraries which trap some signals preventing Perl from working properly with system. You need to set SIGCHILD and perhaps some other signals back to default behavior after connection. If you search the dbi-users mailing list (http://dbi.perl.org) you'll find this crops up quite a bit. Martin -- Martin J. Evans Wetherby, UK
On Thu Mar 17 14:46:47 2011, MJEVANS wrote: Show quoted text
> On Thu Mar 17 13:37:31 2011, derekschwab wrote:
> > When connecting without specifying an SID in the connection string > > causes subsequent system() function calls to always return -1. The > > database connection is successful and the commands inside the system > > calls execute successfully, but return value from the system() call is > > always -1. > > > > Script to reproduce the behavior: > > > > #!/usr/bin/perl > > > > use strict; > > use DBI; > > use DBD::Oracle; # only referenced to display version > > > > print "DBI::VERSION: " . $DBI::VERSION . "\n"; > > print "DBD::Oracle::VERSION: " . $DBD::Oracle::VERSION . "\n"; > > > > my $rc; > > > > $rc = system("/bin/true"); > > print "RC = $rc\n"; > > my $dbh = DBI->connect("dbi:Oracle:", "username", "password"); > > $dbh->disconnect; > > $rc = system("/bin/true"); > > print "RC = $rc\n"; > > > > This produces the output: > > > > DBI::VERSION: 1.616 > > DBD::Oracle::VERSION: 1.27 > > RC = 0 > > RC = -1 > > > > Details about my environment: > > > > cat /etc/redhat-release: > > Red Hat Enterprise Linux Server release 5.4 (Tikanga) > > > > uname -a: > > Linux hostname 2.6.18-164.9.1.el5 #1 SMP Wed Dec 9 03:27:37 EST > > 2009 x86_64 x86_64 x86_64 GNU/Linux > > > > perl -v: > > This is perl, v5.8.8 built for x86_64-linux-thread-multi > > > > sqlplus: > > SQL*Plus: Release 11.2.0.2.0 Production on Thu Mar 17 13:23:50 2011 > > ... > > > > This behavior doesn't happen when I specify the SID as part of the > > connection string e.g., 'dbi:Oracle:mysid'.
> > This is a known issue with the Oracle client libraries which trap some > signals preventing Perl from working properly with system. You need to > set SIGCHILD and perhaps some other signals back to default behavior > after connection. > > If you search the dbi-users mailing list (http://dbi.perl.org) you'll > find this crops up quite a bit. > > Martin
Here are some links: http://www.mail-archive.com/dbi-users@perl.org/msg32752.html http://www.mail-archive.com/dbi-users@perl.org/msg25599.html http://www.mail-archive.com/dbi-users@perl.org/msg32530.html There are more. This is not a bug in DBD::Oracle and the latest release candidate even adds a connection attribute to allow you ro return signals to the default. Martin -- Martin J. Evans Wetherby, UK