Skip Menu |

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

Report information
The Basics
Id: 57484
Status: rejected
Priority: 0/
Queue: DBD-mysql

People
Owner: CAPTTOFU [...] cpan.org
Requestors: frankie [...] etsetb.upc.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 4.012
  • 4.014
Fixed in: (no value)



Subject: connect to network host changes locale
When doing a connection to a network database, the locale setting is changed. It doesn't when doing a local connection. Actually I am not sure wether I should say changed or maybe activated because it switches from default 'C' to my LANG environment variable. Anyway this is unexpected and caused bad behaviour to the main code. In addition it was really very hard to find out where did it comes from. Here is an example. I insert the output inside the code so you can see what happens: #!/usr/bin/perl use DBI; use POSIX; warn setlocale(LC_NUMERIC); -> *C* eval { my $dbh= DBI->connect("DBI:mysql"); }; warn setlocale(LC_NUMERIC); -> *C* eval { my $dbh= DBI->connect("DBI:mysql:hostname=WHATEVER"); }; warn setlocale(LC_NUMERIC); -> *ca_ES.UTF-8* This i perl v5.10.1 on Ubuntu 10.04.
There's nothing in the driver that I can find that has anything to do with the locale. This may be an issue with the actual MySQL client library. On Fri May 14 03:51:22 2010, FRANKIE wrote: Show quoted text
> When doing a connection to a network database, the locale setting is > changed. It doesn't when doing a local connection. > > Actually I am not sure wether I should say changed or maybe activated > because it switches from default 'C' to my LANG environment variable. > Anyway this is unexpected and caused bad behaviour to the main code. In > addition it was really very hard to find out where did it comes from. > > > Here is an example. I insert the output inside the code so you can see > what happens: > > #!/usr/bin/perl > use DBI; > use POSIX; > > warn setlocale(LC_NUMERIC); > -> *C* > > eval { my $dbh= DBI->connect("DBI:mysql"); }; > warn setlocale(LC_NUMERIC); > -> *C* > > eval { my $dbh= DBI->connect("DBI:mysql:hostname=WHATEVER"); }; > warn setlocale(LC_NUMERIC); > -> *ca_ES.UTF-8* > > This i perl v5.10.1 on Ubuntu 10.04.
MySQL client issue, not DBD::mysql itself.