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

People
Owner: champoux [...] pythian.com
Requestors: peter [...] crazymonkeys.de
Cc:
AdminCc:

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



Subject: DBD::Oracle Bug: ora_charset lost in second database connection
Date: Mon, 12 Dec 2011 20:05:24 +0100
To: bug-DBD-Oracle [...] rt.cpan.org
From: Peter Albrecht <peter [...] crazymonkeys.de>
Hello developers, ++ Brief problem description ora_charset lost in second database connection ++ Detailed problem description I connect to a database, using a certain character set (AL32UTF8) at client side. Then I execute a SELECT-statement and process the results. Everything fine so far. Then I disconnect and immediately do the same connect again. A following SELECT (same statement as above) returns successfully, but the german "Umlaute" in my case are broken: Instead of "München" I get "Munchen". Value "0x75" instead of "U+00FC". ++ Reproduce +++ Prepare DB ---------------------------------- 8< ---------------------------------- CREATE TABLE CITIES ( ID NUMBER, TEXT VARCHAR2(64) ); INSERT INTO "CITIES" (ID, TEXT) VALUES ('1', 'Berlin'); INSERT INTO "CITIES" (ID, TEXT) VALUES ('2', 'München'); INSERT INTO "CITIES" (ID, TEXT) VALUES ('3', 'Hamburg'); ---------------------------------- >8 ---------------------------------- +++ Test-program ---------------------------------- 8< ---------------------------------- #!/bin/perl use Devel::Peek; use DBI; getData(); getData(); sub getData{ # TODO: set connection parameters for your db my $dbh = DBI->connect( "dbi:Oracle:host=$host;sid=$sid;port=$port", $dbUser, $dbPassword, { ora_charset => 'AL32UTF8', # ora_verbose => 6, } ); my $sth = $dbh->prepare("SELECT TEXT FROM CITIES WHERE id = '2'"); $sth->execute(); my $data = $sth->fetchrow_hashref(); Dump($data->{TEXT}); # SELECT should find one data record, so this second fetch should close $sth $sth->fetchrow_hashref(); $dbh->disconnect(); } ---------------------------------- >8 ---------------------------------- +++ Test-program output Actual output: ---------------------------------- 8< ---------------------------------- SV = PV(0x8429c7c) at 0x84406b4 REFCNT = 1 FLAGS = (POK,pPOK,UTF8) PV = 0x854f574 "M\303\274nchen"\0 [UTF8 "M\x{fc}nchen"] CUR = 8 LEN = 12 SV = PV(0x8429c7c) at 0x84406e4 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x854f614 "Munchen"\0 CUR = 7 LEN = 8 ---------------------------------- >8 ---------------------------------- Expected output: ---------------------------------- 8< ---------------------------------- ... PV = 0x854f574 "M\303\274nchen"\0 [UTF8 "M\x{fc}nchen"] ... PV = 0x854f574 "M\303\274nchen"\0 [UTF8 "M\x{fc}nchen"] ... ---------------------------------- >8 ---------------------------------- +++ Additional Debug Output Setting "ora_verbose = 6" at connect time show the following output: at first connect ... OCIAttrGet(##adr##,OCI_HTYPE_ENV,b744348e,0,262,##adr##)=SUCCESS charset id=873, name=AL32UTF8, ncharset id=1, name=US7ASCII (csid: utf8=871 al32utf8=873) ... at second connect ... OCIAttrSet(0,OCI_HTYPE_SESSION, b7439dd2,7,Attr=OCI_ATTR_DRIVER_NAME,0)=INVALID_HANDLE ... OCIAttrGet(##adr##,OCI_HTYPE_ENV,b744348e,0,262,##adr##)=SUCCESS charset id=1, name=US7ASCII, ncharset id=1, name=US7ASCII (csid: utf8=871 al32utf8=873) ... ++ Used components and versions DBD::Oracle: v1.34 (also broken in v1.28; worked in v1.27) Perl: v5.10.0 built for i586-linux-thread-multi Operation System: SUSE Linux Enterprise Server 11 (i586), PL 1 Oracle Instant Client: oracle-instantclient11.2-sqlplus-11.2.0.1.0-1 oracle-instantclient11.2-devel-11.2.0.1.0-1 oracle-instantclient11.2-basic-11.2.0.1.0-1 Oracle database: 11g (11.2.0.1.0) Kind regards, Peter Albrecht
Hi! I've tried to reproduce your problem via the test at https://github.com/yanick/DBD-Oracle/blob/rt-73206-ora_charset/t/rt-73206.t Unfortunately, I had no luck: the ora_charset seems to stick. Can you run the same test I used and see if you can see the problem from your side? Joy, `/anick
Subject: Re: [rt.cpan.org #73206] DBD::Oracle Bug: ora_charset lost in second database connection
Date: Thu, 22 Dec 2011 20:00:24 +0100
To: bug-DBD-Oracle [...] rt.cpan.org
From: Peter Albrecht <peter [...] crazymonkeys.de>
Hi `/anick, sorry for the late response. Busy christmas time... ;) I tried your test and could not reproduce the bug either. :( Then I tried the perl-script, I posted in this bug-tracker, and was also not able to reproduce the bug!?!?! I don't get it! I tried DBD::Oracle versions 1.27, 1.28 and 1.36 All three worked correct. This is great, but I have no clue, where my bug went. I also tried two servers at work, which showed this bug at 12.12.2011. No one installed new CPAN modules or operation system patches. Also my DB-Admin swears not having changed anything at the database. So the bugs seems to be vanished. You can close this tracker. Sorry for stealing your time! Greats, Peter (with a few questionmarks above his head) P.S.: Thanks for your response and thanks for the great work at this Oracle-Driver! On 16.12.2011 22:37, Pythian Remote DBA via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=73206 > > > Hi! > > I've tried to reproduce your problem via the test at > > https://github.com/yanick/DBD-Oracle/blob/rt-73206-ora_charset/t/rt-73206.t > > Unfortunately, I had no luck: the ora_charset seems to stick. Can you > run the same test I used and see if you can see the problem from your side? > > Joy, > `/anick >
Subject: Re: [rt.cpan.org #73206] DBD::Oracle Bug: ora_charset lost in second database connection
Date: Fri, 23 Dec 2011 14:07:03 -0500
To: bug-DBD-Oracle [...] rt.cpan.org
From: Yanick Champoux <champoux [...] pythian.com>
On 12/22/11 14:00, Peter Albrecht via RT wrote: Show quoted text
> sorry for the late response. Busy christmas time... ;)
Heh. No problem. I think I can relate to that one. ;-) Show quoted text
> So the bugs seems to be vanished. You can close this tracker. Sorry
for stealing your time! Oh, no problem. The whole thing is indeed quite puzzling. But then, Unicode seems to draw those odd things. Considering that, it's really not surprising that the people who built the tower of Babel ended up with so many problems. ;-) So I'll close the ticket for now. But if you ever manage to reproduce your original problem, don't hesitate to poke us back! Show quoted text
> P.S.: Thanks for your response and thanks for the great work at this
Oracle-Driver! You are quite welcome. Although you should thank the real work-horses like Martin J. Evans. Me, I mostly shuffle tickets around and make sure that releases get done on a semi-consistent basis. :-) Cheers, `/anick -- Yanick Champoux, Senior Perl Developer The Pythian Group - love your data http://www.pythian.com -- Pythian proud winner of Oracle North America Titan Award for Exadata Solution...watch the video on pythian.com