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: 85882
Status: rejected
Priority: 0/
Queue: DBD-Oracle

People
Owner: Nobody in particular
Requestors: janne [...] val.se
Cc:
AdminCc:

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



Subject: DBI->connect sets LC_NUMERIC to C
Date: Wed, 05 Jun 2013 13:48:38 +0200
To: bug-DBI [...] rt.cpan.org
From: Jan Carlsson <janne [...] val.se>
Versions: DBI: 1.609 DBD::Oracle 1.52 perl: 5.10.1 platform: RHEL6 Oracle: 11.2.0.3.0 After DBI->connect to an Oracle database, the LC_NUMERIC locale has been set to C. Script which reproduces the error: ---------------------------------------------- #!/usr/bin/perl use strict; use warnings; use DBI; use POSIX; use locale; setlocale(LC_ALL,'sv_SE.iso88591'); print "locale=",setlocale(LC_ALL),"\n"; my $sid = $ENV{'ORACLE_SID'}; my($uid,$pwd) = split('/',$ENV{'UIDPWD'}); my $dbh = DBI->connect("dbi:Oracle:$sid",$uid,$pwd,{ RaiseError => 1, AutoCommit => 0 }); print "locale=",setlocale(LC_ALL),"\n"; ---------------------------------------------- When the script is run, the output is: locale=sv_SE.iso88591 locale=LC_CTYPE=sv_SE.iso88591;LC_NUMERIC=C;LC_TIME=sv_SE.iso88591;LC_COLLATE=sv_SE.iso88591;LC_MONETARY=sv_SE.iso88591;LC_MESSAGES=sv_SE.iso88591;LC_PAPER=sv_SE.iso88591;LC_NAME=sv_SE.iso88591;LC_ADDRESS=sv_SE.iso88591;LC_TELEPHONE=sv_SE.iso88591;LC_MEASUREMENT=sv_SE.iso88591;LC_IDENTIFICATION=sv_SE.iso88591 Regards, Jan Carlsson
On Wed Jun 05 07:49:04 2013, janne@val.se wrote: Show quoted text
> Versions: > DBI: 1.609 > DBD::Oracle 1.52 > perl: 5.10.1 > platform: RHEL6 > Oracle: 11.2.0.3.0 > > After DBI->connect to an Oracle database, the LC_NUMERIC locale has > been > set to C. > > Script which reproduces the error: > > ---------------------------------------------- > #!/usr/bin/perl > > use strict; > use warnings; > use DBI; > use POSIX; > use locale; > > setlocale(LC_ALL,'sv_SE.iso88591'); > print "locale=",setlocale(LC_ALL),"\n"; > my $sid = $ENV{'ORACLE_SID'}; > my($uid,$pwd) = split('/',$ENV{'UIDPWD'}); > my $dbh = DBI->connect("dbi:Oracle:$sid",$uid,$pwd,{ RaiseError => 1, > AutoCommit => 0 }); > print "locale=",setlocale(LC_ALL),"\n"; > ---------------------------------------------- > > When the script is run, the output is: > > locale=sv_SE.iso88591 > locale=LC_CTYPE=sv_SE.iso88591;LC_NUMERIC=C;LC_TIME=sv_SE.iso88591;LC_COLLATE=sv_SE.iso88591;LC_MONETARY=sv_SE.iso88591;LC_MESSAGES=sv_SE.iso88591;LC_PAPER=sv_SE.iso88591;LC_NAME=sv_SE.iso88591;LC_ADDRESS=sv_SE.iso88591;LC_TELEPHONE=sv_SE.iso88591;LC_MEASUREMENT=sv_SE.iso88591;LC_IDENTIFICATION=sv_SE.iso88591 > > Regards, Jan Carlsson
No where in DBD::Oracle does the string LC_NUMERIC or even LC_ or setlocale exist. I suspect this is happening in the Oracle provided Oracle client library. Martin -- Martin J. Evans Wetherby, UK
I've looked again I cannot see anywhere where DBD::Oracle touches your locale. I believe this must be in the oracle client libs but I cannot prove that right now. If I run a perl script which connects to Oracle under the debugger I can see setlocale being called from a few places: #0 0x00007ffff76ca3d4 in setlocale () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff7b8fad6 in Perl_init_i18nl10n () from /usr/lib/libperl.so.5.14 #2 0x00007ffff7aa4dc0 in perl_construct () from /usr/lib/libperl.so.5.14 #3 0x0000000000400cf1 in main () #0 0x00007ffff76ca3d4 in setlocale () from /lib/x86_64-linux-gnu/libc.so.6 #1 0x00007ffff7a8fbf4 in ?? () from /usr/lib/libperl.so.5.14 #2 0x00007ffff7ac56c3 in Perl_yylex () from /usr/lib/libperl.so.5.14 #3 0x00007ffff7acb4e4 in Perl_yyparse () from /usr/lib/libperl.so.5.14 #4 0x00007ffff7b4538d in ?? () from /usr/lib/libperl.so.5.14 #5 0x00007ffff7b4f821 in Perl_pp_require () from /usr/lib/libperl.so.5.14 #6 0x00007ffff7b0acc6 in Perl_runops_standard () from /usr/lib/libperl.so.5.14 #7 0x00007ffff7aa65ee in Perl_call_sv () from /usr/lib/libperl.so.5.14 #8 0x00007ffff7aa6c2d in Perl_call_list () from /usr/lib/libperl.so.5.14 #9 0x00007ffff7a90739 in ?? () from /usr/lib/libperl.so.5.14 #10 0x00007ffff7a9de11 in Perl_newATTRSUB () from /usr/lib/libperl.so.5.14 #11 0x00007ffff7a9e518 in Perl_utilize () from /usr/lib/libperl.so.5.14 #12 0x00007ffff7accb3f in Perl_yyparse () from /usr/lib/libperl.so.5.14 #13 0x00007ffff7aab067 in perl_parse () from /usr/lib/libperl.so.5.14 #14 0x0000000000400d1e in main () etc but none of them seems to come from DBD::Oracle or the Oracle client libs. Also your example outputs the following for me: locale=LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=en_GB.UTF-8;LC_ADDRESS=en_GB.UTF-8;LC_TELEPHONE=en_GB.UTF-8;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=en_GB.UTF-8 locale=LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=en_GB.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=en_GB.UTF-8;LC_ADDRESS=en_GB.UTF-8;LC_TELEPHONE=en_GB.UTF-8;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=en_GB.UTF-8 and I have not LC_* envs set at all but I have LANG set to en_GB.UTF-8. If I remove LANG I get: locale=C locale=C So, I suspect your problem lies elsewhere and I will reject this RT for now. If you would like to reopen it with further evidence then by means do and I'll look at it again. Martin