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

People
Owner: Nobody in particular
Requestors: Heinrich.Mislik [...] univie.ac.at
Cc:
AdminCc:

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



From Heinrich.Mislik [...] univie.ac.at Tue Aug 27 12: 07:55 2013
MIME-Version: 1.0
X-Spam-Status: No, score=-8.8 tagged_above=-99.9 required=10 tests=[AWL=-1.800, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Mailer: Pegasus Mail for Windows (4.41)
X-Univie-Virus-Scan: scanned by ClamAV on justin.univie.ac.at
X-Spam-Flag: NO
X-Virus-Checked: Checked
content-type: text/plain; charset="utf-8"
Message-ID: <521CEAEA.16341.61571C6E [...] Heinrich.Mislik.univie.ac.at>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Return-Receipt-To: "Heinrich Mislik" <Heinrich.Mislik [...] univie.ac.at>
Organization: ZID
X-Spam-Score: -8.8
X-Confirm-Reading-To: "Heinrich Mislik" <Heinrich.Mislik [...] univie.ac.at>
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id BF4E0240517 for <cpan-bug+DBD-Oracle [...] hipster.bestpractical.com>; Tue, 27 Aug 2013 12:07:55 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vVFAMefR5dnR for <cpan-bug+DBD-Oracle [...] hipster.bestpractical.com>; Tue, 27 Aug 2013 12:07:53 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 4646F2411F0 for <bug-DBD-Oracle [...] rt.cpan.org>; Tue, 27 Aug 2013 12:07:52 -0400 (EDT)
Received: (qmail 14141 invoked by alias); 27 Aug 2013 16:07:52 -0000
Received: from grace.univie.ac.at (HELO grace.univie.ac.at) (131.130.3.115) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Tue, 27 Aug 2013 09:07:43 -0700
Received: from justin.univie.ac.at ([131.130.3.111] helo=justin.univie.ac.at) by grace.univie.ac.at with esmtp (Exim 4.80) (envelope-from <Heinrich.Mislik [...] univie.ac.at>) id 1VELnu-0005Ah-Fq for bug-DBD-Oracle [...] rt.cpan.org; Tue, 27 Aug 2013 18:07:38 +0200
Received: from wsmi.cc.univie.ac.at ([131.130.2.200]) by justin.univie.ac.at with esmtp (Exim 4.80) (envelope-from <Heinrich.Mislik [...] univie.ac.at>) id 1VELnu-0007JP-Do for bug-DBD-Oracle [...] rt.cpan.org; Tue, 27 Aug 2013 18:07:38 +0200
Authentication-Results: hipster.bestpractical.com (amavisd-new); dkim=pass header.i= [...] univie.ac.at
Delivered-To: cpan-bug+DBD-Oracle [...] hipster.bestpractical.com
Content-Description: Mail message body
Subject: UTF-8 flag incorrect with multiple connections
Return-Path: <Heinrich.Mislik [...] univie.ac.at>
X-RT-Mail-Extension: dbd-oracle
X-Original-To: cpan-bug+DBD-Oracle [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Dkim-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=univie.ac.at; s=rev2; h=Content-description:Content-transfer-encoding:Content-type:Message-ID:Subject:MIME-Version:Date:To:From; bh=sOyMvVI6c1Kj+zqOuyyC3r5cFOHwlm6GUMBWxznPeFc=; b=FkaSRWdTTkODfq9TyBx5aO+TZd66JFLqoddazF4VQWMwxQmbtRc3pC+OOaSe8favzsH1lNiaXaBqwEKCMZ4lBeIGRtLtsfHEJ/kxEODlLZrCcXNrUzzLCO1nc1SVxRH3h0IGgcyKHfr1i7uYXi4G1PlRSztaEtSrrfk/ShqESqs=;
Date: Tue, 27 Aug 2013 18:07:38 +0200
X-Spam-Level:
X-PMRQC: 1
Priority: normal
To: bug-DBD-Oracle [...] rt.cpan.org
Content-Transfer-Encoding: Quoted-printable
From: "Heinrich Mislik" <Heinrich.Mislik [...] univie.ac.at>
X-RT-Original-Encoding: utf-8
X-RT-Interface: Email
Content-Length: 5164
When opening multiple connections with utf-8 and non utf-8 charactersets, the utf-8 flag is sometimes not correctly set. The charset is stored in a global variable resulting in the value of the last opened connection used. The charset should be stored with the connection. Here is sample code: use warnings; use strict; use DBI; my ($db,$user,$pass) = qw(somedb someuser somepass); my $dbh1 = DBI->connect("dbi:Oracle:$db", $user, $pass, {ora_charset=>'we8iso8859p15'}); my $x = $dbh1->selectrow_array("select chr(50084) from dual"); warn "$x->",utf8::is_utf8($x),"\n"; my $dbh2 = DBI->connect("dbi:Oracle:$db", $user, $pass, {ora_envhp => 0,ora_charset=>'al32utf8'}); $x = $dbh2->selectrow_array("select chr(50084) from dual"); warn "$x->",utf8::is_utf8($x),"\n"; $x = $dbh1->selectrow_array("select chr(50084) from dual"); warn "$x->",utf8::is_utf8($x),"\n"; DBI->connect("dbi:Oracle:$db", $user, $pass, {ora_envhp => 0,ora_charset=>'we8iso8859p15'}); $x = $dbh2->selectrow_array("select chr(50084) from dual"); warn "$x->",utf8::is_utf8($x),"\n"; print "$DBD::Oracle::VERSION\n"; __END__ On a terminal not capable of utf-8 This prints: ä-> À->1 ä->1 À-> 1.66 perl -V Summary of my perl5 (revision 5 version 10 subversion 1) configuration: Platform: osname=linux, osvers=2.6.18-308.1.1.el5, archname=x86_64-linux- thread-multi uname='linux x86-001.build.bos.redhat.com 2.6.18-308.1.1.el5 #1 smp fri feb 17 16:51:01 est 2012 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,- D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer- size=4 -m64 -mtune=generic -DDEBUGGING=-g -Dversion=5.10.1 - Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local - Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 - Dprivlib=/usr/share/perl5 -Darchlib=/usr/lib64/perl5 - Dvendorlib=/usr/share/perl5/vendor_perl - Dvendorarch=/usr/lib64/perl5/vendor_perl -Dinc_version_list=5.10.0 - Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Duselargefiles - Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow - Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n - Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr - Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto - Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict- aliasing -pipe -fstack-protector -I/usr/local/include - D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe - fstack-protector -I/usr/local/include' ccversion='', gccversion='4.4.6 20110731 (Red Hat 4.4.6-3)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -fstack-protector' libpth=/usr/local/lib64 /lib64 /usr/lib64 libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.12' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E - Wl,-rpath,/usr/lib64/perl5/CORE' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,- D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer- size=4 -m64 -mtune=generic' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API USE_SITECUSTOMIZE Built under linux Compiled at May 2 2012 10:29:48 @INC: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . uname -a Linux katzi.cc.univie.ac.at 2.6.32-358.0.1.el6.x86_64 #1 SMP Wed Feb 20 11:05:23 EST 2013 x86_64 x86_64 x86_64 GNU/Linux Oracle version: oracle instantclient 11.2.0.3 Thanks Heinrich -- Heinrich Mislik Zentraler Informatikdienst der Universitaet Wien A-1010 Wien, Universitaetsstrasse 7 Tel.: (+43 1) 4277-14056, Fax: (+43 1) 4277-9140
MIME-Version: 1.0
In-Reply-To: <521CEAEA.16341.61571C6E [...] Heinrich.Mislik.univie.ac.at>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <521CEAEA.16341.61571C6E [...] Heinrich.Mislik.univie.ac.at>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-22089-1387300804-567.88185-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1780
Download (untitled) / with headers
text/plain 1.7k
On Tue Aug 27 12:07:56 2013, Heinrich.Mislik@univie.ac.at wrote: Show quoted text
> When opening multiple connections with utf-8 and non utf-8 > charactersets, the utf-8 flag is sometimes not correctly set. The > charset is stored in a global variable resulting in the value of the > last opened connection used. The charset should be stored with the > connection. > > Here is sample code: > > use warnings; > use strict; > use DBI; > > my ($db,$user,$pass) = qw(somedb someuser somepass); > > my $dbh1 = DBI->connect("dbi:Oracle:$db", $user, $pass, > {ora_charset=>'we8iso8859p15'}); > my $x = $dbh1->selectrow_array("select chr(50084) from dual"); > warn "$x->",utf8::is_utf8($x),"\n"; > > my $dbh2 = DBI->connect("dbi:Oracle:$db", $user, $pass, > {ora_envhp => 0,ora_charset=>'al32utf8'}); > $x = $dbh2->selectrow_array("select chr(50084) from dual"); > warn "$x->",utf8::is_utf8($x),"\n"; > > $x = $dbh1->selectrow_array("select chr(50084) from dual"); > warn "$x->",utf8::is_utf8($x),"\n"; > > DBI->connect("dbi:Oracle:$db", $user, $pass, > {ora_envhp => 0,ora_charset=>'we8iso8859p15'}); > > $x = $dbh2->selectrow_array("select chr(50084) from dual"); > warn "$x->",utf8::is_utf8($x),"\n"; > > print "$DBD::Oracle::VERSION\n"; > __END__ > > On a terminal not capable of utf-8 This prints: > > ä-> > À->1 > ä->1 > À-> > 1.66 >
You can try https://github.com/mjegh/DBD-Oracle/tree/rt88185 but read the comment as that branch is not buildable without adding a line to Oracle.pm for the version. Also, I'd not install it, just test it out with: cd DBD-Oracle perl Makefile.PL make make test perl -Iblib/lib -Iblib/arch myscript.pl It passes your example but you might want to try it with whatever you were really doing. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-22089-1387300804-567.88185-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: API
References: <521CEAEA.16341.61571C6E [...] Heinrich.Mislik.univie.ac.at> <rt-4.0.18-22089-1387300804-567.88185-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-7666-1389299033-1020.0-0-0 [...] rt.cpan.org>
Message-ID: <rt-4.0.18-7666-1389299033-846.88185-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
From: bohica [...] ntlworld.com
Content-Length: 2033
Download (untitled) / with headers
text/plain 1.9k
On Tue Dec 17 12:20:04 2013, MJEVANS wrote: Show quoted text
> On Tue Aug 27 12:07:56 2013, Heinrich.Mislik@univie.ac.at wrote:
> > When opening multiple connections with utf-8 and non utf-8 > > charactersets, the utf-8 flag is sometimes not correctly set. The > > charset is stored in a global variable resulting in the value of the > > last opened connection used. The charset should be stored with the > > connection. > > > > Here is sample code: > > > > use warnings; > > use strict; > > use DBI; > > > > my ($db,$user,$pass) = qw(somedb someuser somepass); > > > > my $dbh1 = DBI->connect("dbi:Oracle:$db", $user, $pass, > > {ora_charset=>'we8iso8859p15'}); > > my $x = $dbh1->selectrow_array("select chr(50084) from dual"); > > warn "$x->",utf8::is_utf8($x),"\n"; > > > > my $dbh2 = DBI->connect("dbi:Oracle:$db", $user, $pass, > > {ora_envhp => 0,ora_charset=>'al32utf8'}); > > $x = $dbh2->selectrow_array("select chr(50084) from dual"); > > warn "$x->",utf8::is_utf8($x),"\n"; > > > > $x = $dbh1->selectrow_array("select chr(50084) from dual"); > > warn "$x->",utf8::is_utf8($x),"\n"; > > > > DBI->connect("dbi:Oracle:$db", $user, $pass, > > {ora_envhp => 0,ora_charset=>'we8iso8859p15'}); > > > > $x = $dbh2->selectrow_array("select chr(50084) from dual"); > > warn "$x->",utf8::is_utf8($x),"\n"; > > > > print "$DBD::Oracle::VERSION\n"; > > __END__ > > > > On a terminal not capable of utf-8 This prints: > > > > ä-> > > À->1 > > ä->1 > > À-> > > 1.66 > >
> > You can try https://github.com/mjegh/DBD-Oracle/tree/rt88185 but read > the comment as that branch is not buildable without adding a line to > Oracle.pm for the version. Also, I'd not install it, just test it out > with: > > cd DBD-Oracle > perl Makefile.PL > make > make test > perl -Iblib/lib -Iblib/arch myscript.pl > > It passes your example but you might want to try it with whatever you > were really doing. > > Martin
Did this work for you. Yanick is about to do a new release so it would be useful to know. Martin -- Martin J. Evans Wetherby, UK
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-7666-1389299033-1020.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <521CEAEA.16341.61571C6E [...] Heinrich.Mislik.univie.ac.at> <rt-4.0.18-22089-1387300804-567.88185-0-0 [...] rt.cpan.org> <rt-4.0.18-7666-1389299033-1020.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-25823-1392896678-287.88185-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 733
Download (untitled) / with headers
text/plain 733b
On Thu Jan 09 15:23:53 2014, MJEVANS wrote: Show quoted text
> > You can try https://github.com/mjegh/DBD-Oracle/tree/rt88185 but read > > the comment as that branch is not buildable without adding a line to > > Oracle.pm for the version. Also, I'd not install it, just test it out > > with: > > > > cd DBD-Oracle > > perl Makefile.PL > > make > > make test > > perl -Iblib/lib -Iblib/arch myscript.pl > > > > It passes your example but you might want to try it with whatever you > > were really doing. > > > > Martin
> > Did this work for you. Yanick is about to do a new release so it would > be useful to know. > > Martin
Any chance you could test the above so we can incorporate it in the next release? Martin -- Martin J. Evans Wetherby, UK


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.