Quantcast
Channel: perl.dbi.users
Viewing all 225 articles
Browse latest View live

DBD::XML (22 messages)

$
0
0
I've started working on a DBD::XML driver, and the first pass is looking
good. I'm doing this because of the demise of DBD::AnyData, and
DBD::AnyData2 isn't ready yet, so until it is I wanted XML support.

Before I go any further, is anyone else working on something similar or
is there something already out there? I don't want to re-invent the wheel.

-Nigel


Fwd: Re: DBD::XML (2 messages)

$
0
0

Hi Ron,

On 19/8/16 20:24, Ron Savage wrote:
> Hi Nigel
>
> On 20/08/16 01:51, Tim Bunce wrote:
>> On Fri, Aug 19, 2016 at 10:09:45AM -0400, Nigel Horne wrote:
>>> On 8/19/16 9:56 AM, Tim Bunce wrote:
>>>> On Fri, Aug 19, 2016 at 09:30:32AM -0400, Nigel Horne wrote:
> [snip]
>>>> But I wonder about the name. "DBD::XML" seems to be a bold name,
>>>> implying that it's _the_ DBI interface for data stored in XML files.
>>>> Of course the same kind of issue applies to many other drivers,
>>>> so it's not a major concern, but does seem worth dicussing.
>>>
>>> I'm more than happy to entertain other names if you have any
>>> suggestions.
>
> As a rule, we have DBI (there's just one) and anything it uses
> (DBI::*), and then we have DBIx::* for all our additions in thefield.
> That is, we all agree to explicitly avoid using DBI::*. Even drivers
> loaded by DBI are called DBD::Pg, DBD::mysql, DBD::SQLite, etc.
>
> This usage of $ABCx or $AbcX is a wide-spread convention. E.g.
> Marpa::* is exclusively used by Jeffrey Kegler, and all ours are
> MarpaX::*. But there are many, many modules called ${Something}x::* as
> add-ons to $Something.
>
> And yes, for DBI and other it's 'x', elsewhere it's often 'X'.

For clarification, are you saying that my driver should be called
DBDx::XML? The reason I ask is that all the DBDx::* modules I could
find seem to be extensions to DBI or things that use DBI, rather than
DBI drivers or backends.

Also would that confuse with the existing DBIx::XML code? That does
something entirely different.

-Nigel



how to repersent N:M in DBIx? (3 messages)

$
0
0
Pl refer to this link, it has my exact problem (but it only tells about SQL solution): http://stackoverflow.com/questions/11409869/mysql-nm-relationship-find-rows-with-several-specific-relations
I have three tables:1. products:-> prod-id, prod-name
2. tags:-> tag-id, tag-name
3. product_tags::-> prod-id, csv_tag_id
i read elsewhere on internet that this is not a good database/table design. so i am ready to change that too, but i could not think of any other way to represent this relationship. a given product could have multiple tags, but i have to find - at a given time - only those products which have 'ALL' of multiple given tags.
the SQL suggested on the page is:
SELECT a.*
FROM products a
INNER JOIN product_tags b ON a.product_id = b.product_id
WHERE b.tag_id IN (1,23,54)
GROUP BY a.product_id
HAVING COUNT(1) = 3thank you.Rajeev

DBIx HAVING and COUNT error (6 messages)

$
0
0
DBIx error in webserver log:
[cgi:error] [pid 29640] ... AH01215: Can't locate object method "HAVING" via package "COUNT" (perhaps you forgot to load "COUNT"?)

the query:
my $obj_rs = $schema->resultset('itemList')->serach(
                { t_id => { -in => [ $tStr ] }},
                {
                    group_by => [ qw(i_id) ],
                    HAVING COUNT('t_id') = $tCount
                }
            );

currently database has no records which match the query. but i was not expecting such an error.
what is wrong in my statement?
thank you.Rajeev

DBD for SQL Server (7 messages)

$
0
0
Hey Tim

I'm wondering why there is no DBD module for Microsoft SQL Server?

Is it a technical impossibility, or is it just waiting to be written?

Thank you,

Rob Dixon
Norfolk
England

(Fwd) Issues with Oracle DBD in Cygwin (3 messages)

$
0
0
----- Forwarded message from "Neargarder, Keith" <Keith.Neargarder@USA.GKNAEROSPACE.COM> -----

Date: Fri, 16 Sep 2016 22:16:11 +0000
From: "Neargarder, Keith" <Keith.Neargarder@USA.GKNAEROSPACE.COM>
To: "'timb@cpan.org'" <timb@cpan.org>, "'byterock@cpan.org'" <byterock@cpan.org>, "'yanick@cpan.org'" <yanick@cpan.org>, "'mjevans@cpan.org'" <mjevans@cpan.org>
Subject: Issues with Oracle DBD in Cygwin

Gentlemen,



Any assistance is greatly appreciated. I have been working on this for days now and am completely stuck.
I cannot find a way past the error below. I have searched online and tried everything I have found and
no luck. Wasn't sure if I should just create another Cygwin/DBD-Oracle post or what???



Suggestions please???



Let me know if you need more info. I tried to be as thorough as possible.



Couple of things I have noticed that seem off to me and might be an issue???

1. after unpacking the instant client files into c:\oracle\instantclient_12_1 (set as ORACLE_HOME)
I do NOT have a "lib" or "rdbms/lib" subdirectory - am I missing something? I have been using
LD_LIBRARY_PATH=$ORACLE_HOME/lib and I see it and the rdbms/lib referenced in LD_RUN_PATH but those
directories do not exist. If it were a problem I sure would expect some sort of error message but
nothing jumps out at me???

2. I cannot connect to my target database with the sqlplus installed under instant client however
I can connect using another Oracle client installed on the same server. Obviously this is an issue but I
don't believe I am even getting to the point where my Perl script tries to connect as it cannot even
load the Oracle.dll. With sqlplus I get the error: ORA-12154: TNS:could not resolve the connect
identifier specified

3. Tried using the other Oracle client I have installed where sqlplus does work but still get the
same error when trying to run my Perl script.

4. when running "perl Makefile.pl -V 12.1.0" one thing/difference that caught my eye is in my
output it has a line "Generating a Unix-style Makefile" whereas I have seen on another Gygwin/DBD-Oracle
post "Generating a GNU-style Makefile" - could this be an issue??? The make file seems to "work", runs
to completion and creates all the targets, so I guess it is OK.



Info:

. Windows Server 2008 R2 SP1 64-bit OS

. Cygwin Version 2.5.1

. Perl 5.22.2 (Cygwin's Perl build, see output of "perl -V" below)

. Oracle 12.1.0 (database on a Linux server if that matters; I am able to connect to it from
this Windows server with sqlplus

. Instant Client 12.1.0.2.0 - first I tried 64-bit, did not work then tried 32-bit when I
remembered another 3^rd party software required 32-bit Oracle client; I downloaded the Instant client
basic, SDK and sqlplus zip files and extracted them all into c:\oracle\instantclient_12_1

. DBD-Oracle 1.74



Environment variables:

. ORACLE_DSN="DBI:Oracle:host=$my_host;sid=$my_sid"

. ORACLE_USERID=$my_user/$my_pass

. ORACLE_HOME=/cygdrive/c/oracle/instantclient_12_1

. LD_LIBRARY_PATH=$ORACLE_HOME/lib



Steps taken (as outlined in Cygwin.pod):

5. extracted the DBD-Oracle 1.74 package into my personal work directory
/home/svb000028/perl5/DBD-Oracle-1.74

6. cd /home/svb000028/perl5/DBD-Oracle-1.74

7. generated the liboci.a using: dlltool --input-def oci.def --output-lib liboci.a

8. downloaded instant client packages and unpacked them into the c:\oracle\instantclient_12_1
directory.

9. set environment variables (see above), tried ORACLE_USERID with and without the trailing
"@$my_sid" as I have seen it both ways in different posts

10. ran: perl Makefile.pl (see output below)

11. ran: make (see output below)

12. tried make test but all those fail so not much use

13. ran: make install (see output below)

14. ran my own simple test.pl script to test out DBD-Oracle connection; tried variations of connect
info but nothing works; using line as suggested in Cygwin.pod, sample connect line below(from test.pl
line 152):

$dbh = DBI->connect(

"dbi:Oracle:host=$my_host;sid=$my_sid",

$my_user, $my_pass);



Error/output from test.pl:



$ test.pl

install_driver(Oracle) failed: Can't load
'/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:
Exec format error at /usr/lib/perl5/5.22/x86_64-cygwin-threads/DynaLoader.pm line 193.

at (eval 35) line 3.

Compilation failed in require at (eval 35) line 3.

Perhaps a required shared library or dll isn't installed where expected

at /home/svb000028/util/test.pl line 152.



perl -V output:



$ perl -V

Summary of my perl5 (revision 5 version 22 subversion 2) configuration:



Platform:

osname=cygwin, osvers=2.5.1(0.29753), archname=cygwin-thread-multi

uname='cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin '

config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cygwin-threads
-Dlibperl=cygperl5_22.dll -Dcc=gcc -Dld=g++ -Accflags=-ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv'

hint=recommended, useposix=true, d_sigaction=define

useithreads=define, usemultiplicity=define

use64bitint=define, use64bitall=define, uselongdouble=undef

usemymalloc=n, bincompat5005=undef

Compiler:

cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2',

optimize='-O3',

cppflags='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong'

ccversion='', gccversion='5.3.0', gccosandvers=''

intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3

d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3

ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8

alignbytes=8, prototype=define

Linker and Libraries:

ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base
-fstack-protector-strong'

libpth=/usr/lib

libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat

perllibs=-lpthread -ldl -lcrypt

libc=/usr/lib/libcygwin.a, so=dll, useshrplib=true, libperl=cygperl5_22.dll

gnulibc_version=''

Dynamic Linking:

dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '

cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols
-Wl,--enable-auto-image-base -fstack-protector-strong'





Characteristics of this binary (from libperl):

Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS

PERL_DONT_CREATE_GVSV

PERL_HASH_FUNC_ONE_AT_A_TIME_HARD

PERL_IMPLICIT_CONTEXT PERL_NEW_COPY_ON_WRITE

PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV

USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS

USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE

USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME

USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API

Built under cygwin

Compiled at Apr 30 2016 17:04:50

@INC:

/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads

/usr/lib/perl5/site_perl/5.22

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads

/usr/lib/perl5/vendor_perl/5.22

/usr/lib/perl5/5.22/x86_64-cygwin-threads

/usr/lib/perl5/5.22

.





perl Makefile.pl -V 12.1.0 output:



$ perl Makefile.pl -V 12.1.0

Using DBI 1.636 (for perl 5.022002 on cygwin-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/



Configuring DBD::Oracle for perl 5.022002 on cygwin (cygwin-thread-multi)



Remember to actually *READ* the README file! Especially if you have any problems.



Installing on a cygwin, Ver#2.5

Using Oracle in /cygdrive/c/oracle/instantclient_12_1

DEFINE _SQLPLUS_RELEASE = "1201000200" (CHAR)

Forcing Oracle version to be treated as 12.1.0

Oracle version 12.1.0 (12.1)

Using OCI directory 'sdk'



client_version=12.1





DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112





Checking for functioning wait.ph





System: perl5.022002 cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin

Compiler: gcc -O3 -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2

Linker: /usr/bin/ld

Sysliblist:



Checking if your kit is complete...

Looks good

LD_RUN_PATH=/cygdrive/c/oracle/instantclient_12_1/lib:/cygdrive/c/oracle/instantclient_12_1/rdbms/lib

Using DBD::Oracle 1.74.

Using DBD::Oracle 1.74.

Using DBI 1.636 (for perl 5.022002 on cygwin-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/

Generating a Unix-style Makefile

Writing Makefile for DBD::Oracle

Writing MYMETA.yml and MYMETA.json



*** If you have problems...

read all the log printed above, and the README and README.help.txt files.

(Of course, you have read README by now anyway, haven't you?)



make output:



$ make

cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h

cp lib/DBD/Oracle/Object.pm blib/lib/DBD/Oracle/Object.pm

cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm

cp lib/DBD/Oracle/Troubleshooting/Hpux.pod blib/lib/DBD/Oracle/Troubleshooting/Hpux.pod

cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm

cp lib/DBD/Oracle/Troubleshooting.pod blib/lib/DBD/Oracle/Troubleshooting.pod

cp lib/DBD/Oracle/Troubleshooting/Win64.pod blib/lib/DBD/Oracle/Troubleshooting/Win64.pod

cp lib/DBD/Oracle/Troubleshooting/Linux.pod blib/lib/DBD/Oracle/Troubleshooting/Linux.pod

cp lib/DBD/Oracle/Troubleshooting/Win32.pod blib/lib/DBD/Oracle/Troubleshooting/Win32.pod

cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h

cp lib/DBD/Oracle/Troubleshooting/Vms.pod blib/lib/DBD/Oracle/Troubleshooting/Vms.pod

cp lib/DBD/Oracle/Troubleshooting/Cygwin.pod blib/lib/DBD/Oracle/Troubleshooting/Cygwin.pod

cp lib/DBD/Oracle/Troubleshooting/Sun.pod blib/lib/DBD/Oracle/Troubleshooting/Sun.pod

cp lib/DBD/Oracle.pm blib/lib/DBD/Oracle.pm

cp lib/DBD/Oracle/Troubleshooting/Aix.pod blib/lib/DBD/Oracle/Troubleshooting/Aix.pod

cp lib/DBD/Oracle/Troubleshooting/Macos.pod blib/lib/DBD/Oracle/Troubleshooting/Macos.pod

cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h

Running Mkbootstrap for Oracle ()

chmod 644 "Oracle.bs"

"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs
blib/arch/auto/DBD/Oracle/Oracle.bs 644

"/usr/bin/perl.exe" -p -e "s/~DRIVER~/Oracle/g"
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/Driver.xst > Oracle.xsi

"/usr/bin/perl.exe" "/usr/lib/perl5/5.22/ExtUtils/xsubpp" -typemap
'/usr/lib/perl5/5.22/ExtUtils/typemap' -typemap '/home/svb000028/perl5/DBD-Oracle-1.74/typemap'
Oracle.xs > Oracle.xsc

mv Oracle.xsc Oracle.c

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 Oracle.c

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 dbdimp.c

In file included from dbdimp.h:420:0,

from Oracle.h:52,

from dbdimp.c:21:

dbdimp.c: In function `ora_db_login6':

ocitrace.h:74:7: warning: format `%d' expects argument of type `int', but argument 12 has type `size_t
{aka long unsigned int}' [-Wformat=]

"%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%p,pnl=%p,min=%d,max=%d,incr=%d,
un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\

^

dbdimp.c:725:5: note: in expansion of macro `OCISessionPoolCreate_log_stat'

OCISessionPoolCreate_log_stat(

^

ocitrace.h:74:7: warning: format `%d' expects argument of type `int', but argument 14 has type `size_t
{aka long unsigned int}' [-Wformat=]

"%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%p,pnl=%p,min=%d,max=%d,incr=%d,
un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\

^

dbdimp.c:725:5: note: in expansion of macro `OCISessionPoolCreate_log_stat'

OCISessionPoolCreate_log_stat(

^

In file included from Oracle.h:50:0,

from dbdimp.c:21:

dbdimp.c: In function `ora_st_FETCH_attrib':

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/DBIXS.h:381:45: warning: unused variable
`imp_dbh' [-Wunused-variable]

#define D_imp_dbh_from_sth D_imp_from_child(imp_dbh, imp_dbh_t, imp_sth)

^

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/DBIXS.h:379:39: note: in definition of
macro `D_imp_from_child'

type *name = (type*)(DBIc_PARENT_COM(child))

^

dbdimp.c:4349:9: note: in expansion of macro `D_imp_dbh_from_sth'

D_imp_dbh_from_sth;

^

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 oci8.c

oci8.c: In function `ora_blob_read_mb_piece':

oci8.c:1845:13: warning: format `%lu' expects argument of type `long unsigned int', but argument 6 has
type `ub4 {aka unsigned int}' [-Wformat=]

" blob_read field %d, ftype %d, offset %ld, len %lu, "

^

rm -f blib/arch/auto/DBD/Oracle/Oracle.dll

LD_RUN_PATH="/cygdrive/c/oracle/instantclient_12_1/lib:/cygdrive/c/oracle/instantclient_12_1/rdbms/lib"
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base
-fstack-protector-strong Oracle.o dbdimp.o oci8.o -o blib/arch/auto/DBD/Oracle/Oracle.dll \

/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE/cygperl5_22.dll -L/home/svb000028/perl5/DBD-Oracle-1.74
-loci \



chmod 755 blib/arch/auto/DBD/Oracle/Oracle.dll

Manifying 13 pod documents



make install output:



$ make install

"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs
blib/arch/auto/DBD/Oracle/Oracle.bs 644

Manifying 13 pod documents

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree

Installing /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/mk.pm

Installing /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll

Appending installation info to /usr/lib/perl5/5.22/x86_64-cygwin-threads/perllocal.pod

WARNING: This document may contain technical data whose export is restricted by the Arms Export Control
Act (Title 22, U.S.C., SEQ 2751 ET SEQ) or the Export Administration Act (Title 50, U.S.C., APP
2401-2420). Violations of these export laws are subject to severe criminal penalties. This e-mail is
strictly confidential and intended solely for the addressee. It may contain information which is covered
by legal, professional, or other privilege. If you are not the intended addressee you must not use,
disclose, or copy this transmission. This E-mail is not intended to impose nor shall it be construed as
imposing any legally binding obligation upon any of the GKN group of companies ("GKN"), and/or any
subsidiaries thereof or associated companies thereof. Neither GKN nor any subsidiaries thereof or
associated companies thereof gives any representation or warranty as to the accuracy or completeness of
the contents of this E-mail. GKN shall not be held liable to any person resulting from the use of any
information contained in this E-mail and shall not be liable to any person who acts or omits to do
anything in reliance upon it. Unendorsed export or re-export is prohibited.

----- End forwarded message -----

sth->prepare() setting Active? (8 messages)

$
0
0
Afternoon all,

Should a call to prepare() return an Active statement? (i.e. $sth->{Active} == 1)

This appears to be the behaviour of DBD::Sybase, but not DBD::Pg

--
Russell Howe
rhowe.dbi@siksai.co.uk

SECURITY RELEASE - Buffer overflow in DBD::mysql perl library (1 message)

$
0
0
DBD::mysql is the perl DBI driver for MySQL and the primary way Perl
applications and scripts access MySQL and MariaDB databases. The source
repository is at https://github.com/perl5-dbi/DBD-mysql

A vulnerability was discovered that can lead to a buffer overflow, possibly
triggered by user supplied data. This vulnerability is present in all releases
at least back to versions 3.0 of the driver, which were released in 2005.

The CVE identifier for this vulnerability is CVE-2016-1246.

A version including the fix for this vulnerability is available on CPAN at
https://metacpan.org/pod/DBD::mysql

Users of DBD::mysql are advised to patch their installations as soon as
possible.

We have already made a pre-announcement for this security release at
the distros security mailing list. People using DBD::mysql installed from their
(linux) distributions can expect to receive an updated version soon.

Many thanks to Pali Rohár for discovering and fixing the vulnerability.

--
The DBD::mysql maintainers,
Patrick Galbraith
Michiel Beijen

(Fwd) RE: Issues with Oracle DBD in Cygwin (1 message)

$
0
0
----- Forwarded message from "Neargarder, Keith" <Keith.Neargarder@USA.GKNAEROSPACE.COM> -----

Date: Wed, 12 Oct 2016 12:22:00 +0000
From: "Neargarder, Keith" <Keith.Neargarder@USA.GKNAEROSPACE.COM>
To: "'timb@cpan.org'" <timb@cpan.org>, "'byterock@cpan.org'" <byterock@cpan.org>, "'yanick@cpan.org'" <yanick@cpan.org>, "'mjevans@cpan.org'" <mjevans@cpan.org>
CC: 'Mike Towery' <mtowery@gmail.com>, 'Christopher Jones' <christopher.jones@oracle.com>, "'johnson@Pharmacy.Arizona.EDU'" <johnson@Pharmacy.Arizona.EDU>
Subject: RE: Issues with Oracle DBD in Cygwin

FYI - follow up.



I believe the issue was a 32-bit versus 64-bit problem. I believe the Cygwin Perl is 64-bit and my
Oracle (full) client is 32-bit. I have a 3^rd party application on this server that requires 32-bit
Oracle. Although I believe I tried both 32 and 64-bit instant client when building DBD-Oracle inside
Cygwin and neither worked.



Anyway how I finally got a working version was to download Active State 32-bit Perl for Windows, use PPM
to install DBD-Oracle 1.74 and using my 32-bit full Oracle client everything is looking pretty good. I
removed Cygwin's Perl and am using Windows Perl within the Cygwin environment. This presents some
challenges with directory paths - Windows versus Cygwin - but these challenges seem easier than getting
DBD-Oracle to work within the Cygwin/Perl environment.



Couple of posts that helped in case anyone is interested:

[1]http://www.cs.unc.edu/~jeffay/dirt/FAQ/cygwin-perl.html



[2]http://www.nntp.perl.org/group/perl.dbi.users/2014/01/msg36852.html





From: Neargarder, Keith
Sent: Friday, September 16, 2016 5:16 PM
To: 'timb@cpan.org' <timb@cpan.org>; 'byterock@cpan.org' <byterock@cpan.org>; 'yanick@cpan.org'
<yanick@cpan.org>; 'mjevans@cpan.org' <mjevans@cpan.org>
Subject: Issues with Oracle DBD in Cygwin



Gentlemen,



Any assistance is greatly appreciated. I have been working on this for days now and am completely stuck.
I cannot find a way past the error below. I have searched online and tried everything I have found and
no luck. Wasn't sure if I should just create another Cygwin/DBD-Oracle post or what???



Suggestions please???



Let me know if you need more info. I tried to be as thorough as possible.



Couple of things I have noticed that seem off to me and might be an issue???

1. after unpacking the instant client files into c:\oracle\instantclient_12_1 (set as ORACLE_HOME)
I do NOT have a "lib" or "rdbms/lib" subdirectory - am I missing something? I have been using
LD_LIBRARY_PATH=$ORACLE_HOME/lib and I see it and the rdbms/lib referenced in LD_RUN_PATH but those
directories do not exist. If it were a problem I sure would expect some sort of error message but
nothing jumps out at me???

2. I cannot connect to my target database with the sqlplus installed under instant client however
I can connect using another Oracle client installed on the same server. Obviously this is an issue but I
don't believe I am even getting to the point where my Perl script tries to connect as it cannot even
load the Oracle.dll. With sqlplus I get the error: ORA-12154: TNS:could not resolve the connect
identifier specified

3. Tried using the other Oracle client I have installed where sqlplus does work but still get the
same error when trying to run my Perl script.

4. when running "perl Makefile.pl -V 12.1.0" one thing/difference that caught my eye is in my
output it has a line "Generating a Unix-style Makefile" whereas I have seen on another Gygwin/DBD-Oracle
post "Generating a GNU-style Makefile" - could this be an issue??? The make file seems to "work", runs
to completion and creates all the targets, so I guess it is OK.



Info:

. Windows Server 2008 R2 SP1 64-bit OS

. Cygwin Version 2.5.1

. Perl 5.22.2 (Cygwin's Perl build, see output of "perl -V" below)

. Oracle 12.1.0 (database on a Linux server if that matters; I am able to connect to it from
this Windows server with sqlplus

. Instant Client 12.1.0.2.0 - first I tried 64-bit, did not work then tried 32-bit when I
remembered another 3^rd party software required 32-bit Oracle client; I downloaded the Instant client
basic, SDK and sqlplus zip files and extracted them all into c:\oracle\instantclient_12_1

. DBD-Oracle 1.74



Environment variables:

. ORACLE_DSN="DBI:Oracle:host=$my_host;sid=$my_sid"

. ORACLE_USERID=$my_user/$my_pass

. ORACLE_HOME=/cygdrive/c/oracle/instantclient_12_1

. LD_LIBRARY_PATH=$ORACLE_HOME/lib



Steps taken (as outlined in Cygwin.pod):

5. extracted the DBD-Oracle 1.74 package into my personal work directory
/home/svb000028/perl5/DBD-Oracle-1.74

6. cd /home/svb000028/perl5/DBD-Oracle-1.74

7. generated the liboci.a using: dlltool --input-def oci.def --output-lib liboci.a

8. downloaded instant client packages and unpacked them into the c:\oracle\instantclient_12_1
directory.

9. set environment variables (see above), tried ORACLE_USERID with and without the trailing
"@$my_sid" as I have seen it both ways in different posts

10. ran: perl Makefile.pl (see output below)

11. ran: make (see output below)

12. tried make test but all those fail so not much use

13. ran: make install (see output below)

14. ran my own simple test.pl script to test out DBD-Oracle connection; tried variations of connect
info but nothing works; using line as suggested in Cygwin.pod, sample connect line below(from test.pl
line 152):

$dbh = DBI->connect(

"dbi:Oracle:host=$my_host;sid=$my_sid",

$my_user, $my_pass);



Error/output from test.pl:



$ test.pl

install_driver(Oracle) failed: Can't load
'/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:
Exec format error at /usr/lib/perl5/5.22/x86_64-cygwin-threads/DynaLoader.pm line 193.

at (eval 35) line 3.

Compilation failed in require at (eval 35) line 3.

Perhaps a required shared library or dll isn't installed where expected

at /home/svb000028/util/test.pl line 152.



perl -V output:



$ perl -V

Summary of my perl5 (revision 5 version 22 subversion 2) configuration:



Platform:

osname=cygwin, osvers=2.5.1(0.29753), archname=cygwin-thread-multi

uname='cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin '

config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cygwin-threads
-Dlibperl=cygperl5_22.dll -Dcc=gcc -Dld=g++ -Accflags=-ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv'

hint=recommended, useposix=true, d_sigaction=define

useithreads=define, usemultiplicity=define

use64bitint=define, use64bitall=define, uselongdouble=undef

usemymalloc=n, bincompat5005=undef

Compiler:

cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2',

optimize='-O3',

cppflags='-DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong'

ccversion='', gccversion='5.3.0', gccosandvers=''

intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3

d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3

ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8

alignbytes=8, prototype=define

Linker and Libraries:

ld='g++', ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base
-fstack-protector-strong'

libpth=/usr/lib

libs=-lpthread -lgdbm -ldb -ldl -lcrypt -lgdbm_compat

perllibs=-lpthread -ldl -lcrypt

libc=/usr/lib/libcygwin.a, so=dll, useshrplib=true, libperl=cygperl5_22.dll

gnulibc_version=''

Dynamic Linking:

dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '

cccdlflags=' ', lddlflags=' --shared -Wl,--enable-auto-import -Wl,--export-all-symbols
-Wl,--enable-auto-image-base -fstack-protector-strong'





Characteristics of this binary (from libperl):

Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS

PERL_DONT_CREATE_GVSV

PERL_HASH_FUNC_ONE_AT_A_TIME_HARD

PERL_IMPLICIT_CONTEXT PERL_NEW_COPY_ON_WRITE

PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV

USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS

USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE

USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME

USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API

Built under cygwin

Compiled at Apr 30 2016 17:04:50

@INC:

/usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads

/usr/lib/perl5/site_perl/5.22

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads

/usr/lib/perl5/vendor_perl/5.22

/usr/lib/perl5/5.22/x86_64-cygwin-threads

/usr/lib/perl5/5.22

.





perl Makefile.pl -V 12.1.0 output:



$ perl Makefile.pl -V 12.1.0

Using DBI 1.636 (for perl 5.022002 on cygwin-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/



Configuring DBD::Oracle for perl 5.022002 on cygwin (cygwin-thread-multi)



Remember to actually *READ* the README file! Especially if you have any problems.



Installing on a cygwin, Ver#2.5

Using Oracle in /cygdrive/c/oracle/instantclient_12_1

DEFINE _SQLPLUS_RELEASE = "1201000200" (CHAR)

Forcing Oracle version to be treated as 12.1.0

Oracle version 12.1.0 (12.1)

Using OCI directory 'sdk'



client_version=12.1





DEFINE= -Wall -Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112





Checking for functioning wait.ph





System: perl5.022002 cygwin_nt-6.3 cygwin 2.5.1(0.29753) 2016-04-21 22:14 x86_64 cygwin

Compiler: gcc -O3 -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE -U__STRICT_ANSI__ -ggdb -O2 -pipe
-Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2

Linker: /usr/bin/ld

Sysliblist:



Checking if your kit is complete...

Looks good

LD_RUN_PATH=/cygdrive/c/oracle/instantclient_12_1/lib:/cygdrive/c/oracle/instantclient_12_1/rdbms/lib

Using DBD::Oracle 1.74.

Using DBD::Oracle 1.74.

Using DBI 1.636 (for perl 5.022002 on cygwin-thread-multi) installed in
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/

Generating a Unix-style Makefile

Writing Makefile for DBD::Oracle

Writing MYMETA.yml and MYMETA.json



*** If you have problems...

read all the log printed above, and the README and README.help.txt files.

(Of course, you have read README by now anyway, haven't you?)



make output:



$ make

cp Oracle.h blib/arch/auto/DBD/Oracle/Oracle.h

cp lib/DBD/Oracle/Object.pm blib/lib/DBD/Oracle/Object.pm

cp mk.pm blib/arch/auto/DBD/Oracle/mk.pm

cp lib/DBD/Oracle/Troubleshooting/Hpux.pod blib/lib/DBD/Oracle/Troubleshooting/Hpux.pod

cp lib/DBD/Oracle/GetInfo.pm blib/lib/DBD/Oracle/GetInfo.pm

cp lib/DBD/Oracle/Troubleshooting.pod blib/lib/DBD/Oracle/Troubleshooting.pod

cp lib/DBD/Oracle/Troubleshooting/Win64.pod blib/lib/DBD/Oracle/Troubleshooting/Win64.pod

cp lib/DBD/Oracle/Troubleshooting/Linux.pod blib/lib/DBD/Oracle/Troubleshooting/Linux.pod

cp lib/DBD/Oracle/Troubleshooting/Win32.pod blib/lib/DBD/Oracle/Troubleshooting/Win32.pod

cp dbdimp.h blib/arch/auto/DBD/Oracle/dbdimp.h

cp lib/DBD/Oracle/Troubleshooting/Vms.pod blib/lib/DBD/Oracle/Troubleshooting/Vms.pod

cp lib/DBD/Oracle/Troubleshooting/Cygwin.pod blib/lib/DBD/Oracle/Troubleshooting/Cygwin.pod

cp lib/DBD/Oracle/Troubleshooting/Sun.pod blib/lib/DBD/Oracle/Troubleshooting/Sun.pod

cp lib/DBD/Oracle.pm blib/lib/DBD/Oracle.pm

cp lib/DBD/Oracle/Troubleshooting/Aix.pod blib/lib/DBD/Oracle/Troubleshooting/Aix.pod

cp lib/DBD/Oracle/Troubleshooting/Macos.pod blib/lib/DBD/Oracle/Troubleshooting/Macos.pod

cp ocitrace.h blib/arch/auto/DBD/Oracle/ocitrace.h

Running Mkbootstrap for Oracle ()

chmod 644 "Oracle.bs"

"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs
blib/arch/auto/DBD/Oracle/Oracle.bs 644

"/usr/bin/perl.exe" -p -e "s/~DRIVER~/Oracle/g"
/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/Driver.xst > Oracle.xsi

"/usr/bin/perl.exe" "/usr/lib/perl5/5.22/ExtUtils/xsubpp" -typemap
'/usr/lib/perl5/5.22/ExtUtils/typemap' -typemap '/home/svb000028/perl5/DBD-Oracle-1.74/typemap'
Oracle.xs > Oracle.xsc

mv Oracle.xsc Oracle.c

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 Oracle.c

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 dbdimp.c

In file included from dbdimp.h:420:0,

from Oracle.h:52,

from dbdimp.c:21:

dbdimp.c: In function `ora_db_login6':

ocitrace.h:74:7: warning: format `%d' expects argument of type `int', but argument 12 has type `size_t
{aka long unsigned int}' [-Wformat=]

"%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%p,pnl=%p,min=%d,max=%d,incr=%d,
un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\

^

dbdimp.c:725:5: note: in expansion of macro `OCISessionPoolCreate_log_stat'

OCISessionPoolCreate_log_stat(

^

ocitrace.h:74:7: warning: format `%d' expects argument of type `int', but argument 14 has type `size_t
{aka long unsigned int}' [-Wformat=]

"%sOCISessionPoolCreate(envhp=%p,ph=%p,pn=%p,pnl=%p,min=%d,max=%d,incr=%d,
un=%s,unl=%d,pw=%s,pwl=%d)=%s\n",\

^

dbdimp.c:725:5: note: in expansion of macro `OCISessionPoolCreate_log_stat'

OCISessionPoolCreate_log_stat(

^

In file included from Oracle.h:50:0,

from dbdimp.c:21:

dbdimp.c: In function `ora_st_FETCH_attrib':

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/DBIXS.h:381:45: warning: unused variable
`imp_dbh' [-Wunused-variable]

#define D_imp_dbh_from_sth D_imp_from_child(imp_dbh, imp_dbh_t, imp_sth)

^

/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI/DBIXS.h:379:39: note: in definition of
macro `D_imp_from_child'

type *name = (type*)(DBIc_PARENT_COM(child))

^

dbdimp.c:4349:9: note: in expansion of macro `D_imp_dbh_from_sth'

D_imp_dbh_from_sth;

^

gcc -c -I/cygdrive/c/oracle/instantclient_12_1/sdk/include
-I/cygdrive/c/oracle/instantclient_12_1/rdbms/demo
-I/usr/lib/perl5/vendor_perl/5.22/x86_64-cygwin-threads/auto/DBI -DPERL_USE_SAFE_PUTENV -D_GNU_SOURCE
-U__STRICT_ANSI__ -ggdb -O2 -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/build=/usr/src/debug/perl-5.22.2-1
-fdebug-prefix-map=/mnt/share/maint/perl.x86_64/src/perl-5.22.2=/usr/src/debug/perl-5.22.2-1 -fwrapv
-fno-strict-aliasing -fstack-protector-strong -D_FORTIFY_SOURCE=2 -DUSEIMPORTLIB -O3
-DVERSION=\"1.74\" -DXS_VERSION=\"1.74\" "-I/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE" -Wall
-Wno-comment -DUTF8_SUPPORT -DORA_OCI_VERSION=\"12.1.0\" -DORA_OCI_102 -DORA_OCI_112 oci8.c

oci8.c: In function `ora_blob_read_mb_piece':

oci8.c:1845:13: warning: format `%lu' expects argument of type `long unsigned int', but argument 6 has
type `ub4 {aka unsigned int}' [-Wformat=]

" blob_read field %d, ftype %d, offset %ld, len %lu, "

^

rm -f blib/arch/auto/DBD/Oracle/Oracle.dll

LD_RUN_PATH="/cygdrive/c/oracle/instantclient_12_1/lib:/cygdrive/c/oracle/instantclient_12_1/rdbms/lib"
g++ --shared -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base
-fstack-protector-strong Oracle.o dbdimp.o oci8.o -o blib/arch/auto/DBD/Oracle/Oracle.dll \

/usr/lib/perl5/5.22/x86_64-cygwin-threads/CORE/cygperl5_22.dll -L/home/svb000028/perl5/DBD-Oracle-1.74
-loci \



chmod 755 blib/arch/auto/DBD/Oracle/Oracle.dll

Manifying 13 pod documents



make install output:



$ make install

"/usr/bin/perl.exe" -MExtUtils::Command::MM -e 'cp_nonempty' -- Oracle.bs
blib/arch/auto/DBD/Oracle/Oracle.bs 644

Manifying 13 pod documents

Files found in blib/arch: installing files in blib/lib into architecture dependent library tree

Installing /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/mk.pm

Installing /usr/lib/perl5/site_perl/5.22/x86_64-cygwin-threads/auto/DBD/Oracle/Oracle.dll

Appending installation info to /usr/lib/perl5/5.22/x86_64-cygwin-threads/perllocal.pod

WARNING: This document may contain technical data whose export is restricted by the Arms Export Control
Act (Title 22, U.S.C., SEQ 2751 ET SEQ) or the Export Administration Act (Title 50, U.S.C., APP
2401-2420). Violations of these export laws are subject to severe criminal penalties. This e-mail is
strictly confidential and intended solely for the addressee. It may contain information which is covered
by legal, professional, or other privilege. If you are not the intended addressee you must not use,
disclose, or copy this transmission. This E-mail is not intended to impose nor shall it be construed as
imposing any legally binding obligation upon any of the GKN group of companies ("GKN"), and/or any
subsidiaries thereof or associated companies thereof. Neither GKN nor any subsidiaries thereof or
associated companies thereof gives any representation or warranty as to the accuracy or completeness of
the contents of this E-mail. GKN shall not be held liable to any person resulting from the use of any
information contained in this E-mail and shall not be liable to any person who acts or omits to do
anything in reliance upon it. Unendorsed export or re-export is prohibited.

References

Visible links
1. http://www.cs.unc.edu/~jeffay/dirt/FAQ/cygwin-perl.html
2. http://www.nntp.perl.org/group/perl.dbi.users/2014/01/msg36852.html

----- End forwarded message -----

new DBD::ODBC released (1 message)

$
0
0
I have uploaded DBD::ODBC 1.56 to the CPAN (1.54 was skipped due to an indexing problem).

Here are the changes since the 1.52:

1.53_2 2016-02-03

[MISCELLANEOUS]

Add new FAQs

1.53_1 2015-10-16

[BUG FIXES]

Strictly speaking this is a bug fix to DBI and not DBD::ODBC but DBI
now supports 64 bit row counts where an IV in perl is 64 bits. However, it
necessitated changes to DBD::ODBC to pick up the fix. odbc_rows (my workaround
since 2012) is still supported but should no longer be required so long as you
use this DBD::ODBC and DBI 1.633_92 or above.

[INTERNALS]

Removed dbd_st_rows and now setting DBIc_ROW_COUNT.

[DOCUMENTATION]

Add tables and table_info section to deviations from the DBI spec.

[MISCELLANEOUS]

Change column name in t/rt_101579.t as "method" is a reserved word
in. Teradata Thanks to Zhenyi Zhou.

Remove duplicate dynamic_config from META.yml.

Martin

DBD::mysql 4.037_01 released (1 message)

Re: NewRelic Agent (2 messages)

$
0
0
[I've taken the liberty of CC'ing this to the dbi-users mailing list.]

On Mon, Oct 17, 2016 at 07:20:30AM +0000, Jose Luis Martínez Torres wrote:
> Hello Tim,

Hello Jose.

> I have been thinking of making a NewRelic toolkit for instrumenting the stuff that goes on
> inside an app in an easy way (calls to the database, creating segments for calls to controllers in
> Catalyst, creating segments for calls to external HTTP servers).

Cool.

If you've not looked at http://opentracing.io please do.
There's no perl API yet. Perhaps you could help write one! :)
Though since we're talking about NewRelic I presume you're using that.

> I've looked at the actual state of things on CPAN, and can only find
> Plack::Middleware::NewRelic, for which I have some doubts (for example, I can't explain myself why it's
> using a CHI cache in the _agent_builder method, since Moo is supposed to cache that value...),

Me too: https://github.com/aanari/Plack-Middleware-NewRelic/issues/6 :)

> and then there doesn't seem to be a way of exposing the agent to
> other parts of the software stack (so they can create segments).

Agreed.

I just made it more subclassable:
https://github.com/aanari/Plack-Middleware-NewRelic/pull/4
and then implemented our needs in a subclass.

Perhaps the author, Ali Anari, would be open to having you and I as
co-maintainers so we could move the code forward. I've CC'd this to Ali.


> Since I can't seem to find prior work on this for Perl, was thinking of creating a
> NewRelic Singleton instance that gets initialized by a Plack Middleware (that sets the transaction id
> and initializes the agent), and then let other modules (like a DBI NewRelic Agent get the singleton and
> create segments for their transactions). On that I had doubts on how to handle this in an efficient way:
> your Plack-Middleware-Debug-DBIProfile seems like one way to go. Would you recommend me going down that
> path (when this is thought to be enabled in production environments)? Or going down a path like in this
> blog? [1]https://blog.afoolishmanifesto.com/posts/dbi-caller-info/ (wrapping the prepare method,
> starting a segment there, and then closing the segment on execute in the sth).

Requiring use of a subclass is problematic in some ways and raises the
effort and risks for other people to adopt the tool.

Plack::Middleware has an easy time because there's a very clear entry
and exit point.

The problem with the NewRelic API, IIRC, is that you can't add a segment
retrospectively. There's no way to say "I've just spent $X seconds doing Y".
You have to make an API call at the start of Y and another at the end.
The DBI::Profile mechanism would work for the former but not the later.

Using a subclass, like fREW does in the link you posted, is a reasonable
approach, You'd override some set of methods, at least execute() and
do(), with code that would create and end a NewRelic segment for each call.
(Ideally every kind of select and fetch method should also be wrapped,
if you really want accurate data. Plus prepare() for some drivers. The
list goes on and on but the returns diminish.)

Subclassing the driver would also be possible but there are probably
dragons lurking there.

The Callbacks mechanism is also worth looking into
https://metacpan.org/pod/DBI#Callbacks
The current implementation has two limitations that make it less than
ideal, but both could be implemented (in C) without too much work:
a) there's no way to invoke a callback on _return_ from a method
b) there's no (easy) way to have multiple callbacks, so it's hard to
have multiple modules setting callbacks without them clashing.
The former is what's needed to make Callbacks useful for profiling.


> I also am afraid that others might be already doing stuff around monitoring Perl
> applications with New Relic, but I can't find how they're doing it (on GitHub for example). You, being
> the maintainer of NewRelic::Agent can maybe guide me to people you know are instrumenting their Perl
> code with NewRelic and how they're doing it.

I notice that you're emailing me personally rather than using the
dbi-users mailing list. So you're not helping other like-minded people
to find you :) I suggest you start by emailing dbi-users@perl.org
Or rather, I was going to suggest that but ended up just CC'ing this
reply instead :)

> Since it's the first time I mail you, please let me express my gratitude towards you and
> your work in the Perl community. You are an inspiration for us J

Thanks, and you're welcome!

Tim.

Security release - use after free in DBD::mysql when using preparedstatements (1 message)

$
0
0
DBD::mysql is the perl DBI driver for MySQL and the primary way Perl
applications and scripts access MySQL and MariaDB databases. The
source repository is at https://github.com/perl5-dbi/DBD-mysql.

A vulnerability was discovered that can lead to a use after free when
using prepared statements. This vulnerability is present in all
releases at least back to versions 3.0 of the driver, which were
released in 2005.

The CVE identifier for this vulnerability is CVE-2016-1251.

Version 4.041, including the fix for this vulnerability, is available
on CPAN at https://metacpan.org/pod/DBD::mysql

Users of DBD::mysql using prepared statements are advised to patch
their installations as soon as possible.

Many thanks to Pali Rohár for discovering and fixing the vulnerability.

--
The DBD::mysql maintainers,

Patrick Galbraith Michiel Beijen

Migrating Perl from Solaris to Linux (1 message)

$
0
0
‰PNG

IHDRx3\ûÌ}
´IDATxìԌ\QÅáSÛ¶mÛ¶VQ£ÆF=ûîSmÛZ{·¶Í¨¶Ýž&µ;\üOòý› Éí‹ýsÄ*…83mI´žžV™à¤™sqx¡æ±Æþù|<¡O¯aÏ\”Y©³5v™ ˆ· $ºáaïkß@¼s qÎÕº‚ç<bÍûW‘&©v/ÄY
ûçi~°±ÓSážÒT6d"i‹*…•Îx$X1äc` |`¾F¼{áF.Bš°I C¼öc`þ‚Í’„4a»1q7°ÞfŒ•À~Vœ&lU£%°¿dàç4§e#¤ kH°%°¯o+ìËÒ¼ðéáIcCh4_Çìð,CG3p„jG^@‚c"e6?DC#ÖN;–>6ڄïÚ_ÇXiG´ù)0EMë@ð‚@ʤ*HžÙáa9 Q©:QGœšQàñ¿wXH`!…Xp¥©Õ¤ìø~¥¨%Õ¡œÜ*R+ªŒà¬5 †TÿÓq]Êÿ.5þ$?‚³¬TõS·Ò„)ô„ŽRi|?=¥KTYÚðéy6SŽÿüËQɾœE©<Ư7œîÓzAï?_"å€։Ò#êà¬0%ÒÓOm1›4ÝúEày¤é5ÕAà–@šRñ/ò¡}s€¹e‡¢ðÿlÛ¶mû½kÛ¶mÛ¶mÛ¶mÛöNò5YiæÌ»VÎJVîß=vN7ºgwnÒcœKP²CoäiûHÍ|޽v3ïRñ‡Œû*F§ÅƳè6¦ ]$‡\ÛÁƒ}¹í"=¸7óŒ0ƃƻäy¸ï^ë0ywÚ>’ÊÂg3>ƒ2&ˆüé÷JÀx¯´•ñþ1ú¸ÇWÎÅn¬‘ÃX欦
žà=e"(8…q€qŽq1ò—]áwÈ^5v361>†ìOcc-Œ¤CnìhœÅâW‘\ ³q÷46v2v6î@¾‘û„(øW‘ÿàä„ñ—ŒMY°YÆaƲƻŠß™gšq²±!ÛÇ2ޟôMhìÎX_3V1Öq&¿³‰·Þٍ½Œ9Œÿ±ö™¸ö8ý§±ù“|;%–Æ+
sGqm‹ñ,„ÌgV~Ô!ÚMéŸ+`1ҎgvßJŸï»‘+[ã%ãhŸ›†(ø‘Çù·,lÐxmÅÒAü>ï_—ö;ÌqÚ3ˆ:ßÑö¹^’ÎÈNÈõ¬:‚|‚#’ýùx
YfBWvñ–û•iOâáZÉ8¹‘m¡’¶„hÂ6á뼝¬p—(åe¼Õå¹ðº$Æ%ȧ {7DÁeÉà³È}§]ØÆkÞ Õ“û^aKÛëÂòÌo?vãa<ƒh/4>!Qª4ÿ>C^q˜~EèÓFæ]cl‹''vr<<ž±¹“ù
>Ææ<›Ð7KBÝ&ÂkfÚûŒyèR2à'ƤÏkÆ1juò£°HA
VËo`üטѸY¦iïÑ|@¬ºCÈ|&Ä ‹IN—l´ˆ±¦÷[ÿæïS<£_Äó–‹!|êõûšÐZž¹×Ñ·‘*'z ™®ÛRBuÑmf‚ñÞ#a²ºß$åh“}W£#?hºq †ÒkÃtî…!¬K¿ü´÷;cĪCŒÑL#ŸècL'Õ5ä>¡/ÆøJö3י‹m €4!sÔó<‘¶ŸLõ¤íž{|‚¢DEe§`ö‹Üâ}©ŒßÃg.“kM?žâ»„MXTæéë)ä]/„~Ë<ß±h.((¬Yôd1°Ð,š~?÷+þ”>˜3“©bɞ÷sˆC Çñö<’ùn¢OÂúâíuUÁl9Š~Èç“ÁǐÓLWŸ×k…ƒ·Äk9…òCþа€Çé§ûÅBµÃ@yÐïȔg j|O2ò4\W>Éß®ßxïŠ!
¦„Òçd¹Eökr˜ö2crŒ±:¡{ðgÆ¢ð—Èaö!«ÌŸ\)xjÐk"l‡jO«‚›ÑØk|Ö¨h)¼‹¬mŸýä¾×D¾ÙÇ"[ø:ñ¦1žbP(_Í¢•
u‚çO UÇL(o ‚ÕÃß÷â1žßß#(!ÒíÕSٛ‘3"ºI—4gBEF®u"ƒÖŠÕ.â~÷
eÙgJè¨Ï}YüåaæñÀ/"ÿž÷åÌ5ژ•Á!'ûròv¶šŒ·Ð˜6 „8ÚÂGć2ÿ@cn2÷!Þ}ñYƒEôíHÈ|9?£o2îO´ºœIÔ*‰Ò‡³qO^ÚõŠ-/£ŸÅ„æ"Ɗô7Ý^žD9—‘¬ø?âQ抄»‰>·ùãÁKÅ#çÙï ÝËÏ£òuŸVÁø‹§¨‚EE7¾ +Ä«KX˜}õFÄíd”–ÉFÑ$$ksÍï_'‹ú Ïo­(šóŠô+Êy¾ÏÆ}Þ ìo¼Öxš{ˆ¢_„eŠ÷J­ó~NFžö²Ø—9D˜EFûp@–÷×wHæy;%Ç;àÓRñy—b¼Íº_§¯“ßågã<ی¯pó¼Ïo¹iÐʸ=ì›+ÎQ-Z)…‘4\ÿÙY9mìg–>%½`"ïÍÓ¤¨ò-…†ZÆ5R(&÷ÞÉ{jW©öTäÚ,þvˆCÑå,œN¤Š‘ß°J®7çÕå†G¿ŠÈIҕU¼°¨”ëó—"{¯«CMx-óé¼óà.Ɣ¢ˆüÕ¨a(å1c|‘7¦È0BKpxè©bU%1|Èû¢ã}Êwƒ)'æâ”+)×¥§£ZGùïÆGՐ$ë--ê£ 9)¡†
ðò^à‡óþ)È*BëÇþ‰H…<«W8˜ŒüiڋÙñ¶)õQšô¾ìkÜÆxº.'1ÞM)xÿIií=,þÙ§Š³@º7½Î1]ù¾h9^¦%ÁS(¾-ᴃq;ò']½–È¡H‹ü3Ož y\ÚK)û)žðü¦œÚŒ þ|«Ã
ü-0´NîL•Ð~C£¥q‹ Åø±‰ì£–”ÝVGz5Úc(a¢Ô['³ø?eìBÎIýc¸$GZÚK;¢‚ÁGœ÷n“³Õ'0²mÀ$yÆ©ZC¾²ègÏCÁ{…øý¢àû »ƒü÷Qöd~¨/áÓÖ/<y-ä_Š‚'Ÿ‡‚õ”(/×["ÛÉ6rS¢%ûä÷„«—ák²¯•¯Ô#˙åí$:ëIrܞ9…ì7®—9­
ƈÉ$ñzY,ŽÛ–bo#jL àN’ÈÅ÷>WÕ#Î&´óHŸ·H¾nxԗ¯"¶bÍ;iפOaõðŠk$²:ô;dì(ÇY‹ ««á^ªß—3*R ?€Ñl¦½MŒãƛï:èÛU¶ƒÆuôÝCbö­DŸAòÍÔ
út0ÞØÀºKòÁW%cEXq_þ•ñŽìž Ôý콗f礸#Pè@>ÏÉ%^þáù«IVÆJx~Ù;wΠÙ=¸—1ÿ‘bJRŒnFý¾_je¬^<gY¾ºˆâŠ€$‹­ã&D™åÿô܄ˆâ3ö÷·.~ˆ(Îú¤Ó¢iîIEND®B`‚

DBD::mysql unicode bug fixes in new development release (1 message)

$
0
0
Hi,

(if you rather read a website than plain text, this is also on my
site: https://huntingbears.nl/2016/12/14/dbdmysql-all-your-utf-8-bugs-are-belong-to-us/)

After a couple of years of more or less “maintenance mode” on
DBD::mysql – we had a hand full of people contributing occasional
fixes and a whole slew of drive-by contributors – we now have a
prolific contributor again: Pali Rohár.

It’s great to see some more long-standing issues taken care of!

This time around, in the new development release 4.041_01 that is on
CPAN now (https://metacpan.org/release/MICHIELB/DBD-mysql-4.041_01),
there are some important fixes for some Unicode-related issues that I
would like to point out. The sections below I have distilled based on
the descriptions made by Pali.


Automatically converting to UTF-8 for bind parameters
------------------------------------------------------------
Before this release perl scalars (statements or bind parameters)
without UTF8 status flag were not encoded to UTF-8 even if
mysql_enable_utf8 was enabled. This caused perl scalars with internal
Latin1 encoding to be sent to the mysql server as Latin1 even if
mysql_enable_utf8 was enabled.

Now all statements and bind parameters which are not a DBI binary type
(SQL_BIT, SQL_BLOB, SQL_BINARY, SQL_VARBINARY or SQL_LONGVARBINARY)
are automatically encoded to UTF-8 when mysql_enable_utf8 is enabled.

If mysql_enable_utf8 is not enabled and your statement or bind
parameter contains a wide Unicode character then DBD::mysql shows a
warning. If a binary parameter contains a wide Unicode character then
DBD::mysql shows a warning too, similar like function print without
using a :utf8 perlio layer. (“Wide character in…”)

Perl’s SvPV() returns char* from a perl scalar and the following
SvUTF8() call for that scalar returns true if SvPV returned the data
in UTF-8 or Latin1.


Decoding of UTF-8 fields when mysql_enable_utf8 is enabled
------------------------------------------------------------
For each fetched field mysql server tells us its charset id. Before
this release when mysql_enable_utf8 was enabled DBD::mysql UTF-8
decoded all fields with a charset id different than 63 (which means
binary).

Now DBD::mysql UTF-8 decodes only those fields which have their
charset set to utf8 or utf8mb4. By default mysql server sends data in
encoding specified by SET NAMES command, which is by default Latin1.
So any received Latin1 data is not UTF-8 decoded anymore.

The mysql server sends a charset id, not a charset name. Each
combination of charset name and collation pairs has its own charset
id. A new function charsetnr_is_utf8() has hardcoded all utf8 and
utf8mb4 charset ids from mysql (up to 8.0.0) and mariadb (up to
10.2.2) from their source code. So far it looks like those ids are not
changing since old mysql 5.0, only new ones are added.

Conclusion
---------------
We hope these changes make DBD::mysql a lot more consistent for you.
Since the changes are rather big, we’d urge you to test the
development release 4.041_01 which is on CPAN and give feedback NOW;
this allows us to make changes if needed before we create an actual
stable release with these features.

And of course, if you test it with your software and all is good, we’d
like to hear that as well!

You can leave your feedback via the DBI-users mailing list
(http://lists.perl.org/list/dbi-users.html), or using our GitHub page
(https://github.com/perl5-dbi/DBD-mysql/).

Kindest regards,

Michiel

Error while installing DBD-mysql-4.041 (3 messages)

$
0
0
Hi Support
I am trying to install DBD-mysql-4.041 in ubuntu 14.4 and getting the
bellow error message. Could you please help me to over come the issue?

Message
root1@root1-Veriton-M200-H81:~/Downloads/DBD-mysql-4.041$ perl Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 88.

Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root1' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root1'@'localhost' identified by
's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

Can't exec "mysql_config": No such file or directory at Makefile.PL line
561.
Can't find mysql_config. Use --mysql_config option to specify where
mysql_config is located
Failed to determine directory of mysql.h. Use

perl Makefile.PL --cflags=-I<dir>

to set this directory. For details see DBD::mysql::INSTALL,
section "C Compiler flags" or type

perl Makefile.PL --help

Waiting for your kind suggestions.

Thanks and Regards
Lakshman


--
Lakshman Sahoo (ARS)

Division of Fish Genetics and Biotechnology,
ICAR-Central Institute of Freshwater Aquaculture,
Kausalyaganga, Bhubaneswar, Odisha, India Pin-751002

DBD::CSV attempt to free unreferenced scalar during globaldestruction (2 messages)

$
0
0
Hello,

I'm here looking for help with an issue I'm having with DBD::CSV.

Specifically, I'm attempting to use the 'after_parse' callback to handle a
csv file with a data defined variable number of columns and hit a warning
on an attempt to free unreferenced scalar during global destruction.

I've prepared a minimal example at
https://gist.github.com/kiwiroy/fa0c737ff3f298cb064e554505bc4495 so show
the issue. The two test scripts process the 'input.csv' with Text::CSV and
DBD::CSV respectively and only the latter exhibits the behaviour.

It appears to be 5.24.0 specific. I'm using default perlbrew built perls.

Is there something I'm missing or doing wrong?

Thanks in advance.

Roy

Fwd: DBD::CSV attempt to free unreferenced scalar during globaldestruction (3 messages)

$
0
0
Hi Ron,

Thanks for taking the time to have a look. I see you are using 5.20.2,
could it be that your installed modules are not at the same version as
mine? Sorry for not being more detailed in my report. I've updated the
'cpanfile' to lock to specific versions I'm using and removed the
'quote_empty' option as it is only in Text::CSV_XS >= 1.18
<https://github.com/Tux/Text-CSV_XS/commit/f9133e3684f45a6613002f055e3010743d3ea855>
and
it is not required for this.

I'd be grateful if you could fetch and re-run - without quote_empty
updating modules shouldn't be required (I just ran with Text::CSV_XS
version 1.17 as a check).

Roy

On 17 January 2017 at 10:51, Ron Savage <ron@savage.net.au> wrote:

> Hi Roy
>
> I ran your code - unsuccessfully - and added the output as a comment to
> your gist.
>
>
> On 16/01/17 20:54, Roy Storey wrote:
>
>> Hello,
>>
>> I'm here looking for help with an issue I'm having with DBD::CSV.
>>
>> Specifically, I'm attempting to use the 'after_parse' callback to handle
>> a csv file with a data defined variable number of columns and hit a
>> warning on an attempt to free unreferenced scalar during global
>> destruction.
>>
>> I've prepared a minimal example at
>> https://gist.github.com/kiwiroy/fa0c737ff3f298cb064e554505bc4495 so show
>> the issue. The two test scripts process the 'input.csv' with Text::CSV
>> and DBD::CSV respectively and only the latter exhibits the behaviour.
>>
>> It appears to be 5.24.0 specific. I'm using default perlbrew built perls.
>>
>> Is there something I'm missing or doing wrong?
>>
>> Thanks in advance.
>>
>> Roy
>>
>>
>>
> --
> Ron Savage - savage.net.au
>

FetchHashKeyName emits invalid keys for utf8 fieldnames (2 messages)

$
0
0
Using DBI v 1.636

$dbi->{FetchHashKeyName}=’NAME_lc’ or NAME_uc apparently produces different keys from ‘lc’ and ‘uc’ functions for fieldnames containing non-ascii characters.

For example, ‘ämne-Abc’ with FetchHashKeyName=NAME_lc results in result key ‘\x{0}\x{0}mne-abc’

----
Summary of my perl5 (revision 5 version 24 subversion 0) configuration:

Platform:
osname=linux, osvers=2.6.32-642.6.2.el6.x86_64, archname=x86_64-linux
uname='linux yonkyo.local 2.6.32-642.6.2.el6.x86_64 #1 smp wed oct 26 06:52:09 utc 2016 x86_64 x86_64 x86_64 gnulinux '
config_args='-de -Dprefix=/opt/perlbrew/perls/perl-5.24.0 -Aeval:scriptdir=/opt/perlbrew/perls/perl-5.24.0/bin'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2',
optimize='-O2',
cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.4.7 20120313 (Red Hat 4.4.7-17)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678, doublekind=3
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64
libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=libc-2.12.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.12'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'


Characteristics of this binary (from libperl):
Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_COPY_ON_WRITE
PERL_DONT_CREATE_GVSV
PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT
USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
USE_PERLIO USE_PERL_ATOF
Locally applied patches:
Devel::PatchPerl 1.42
Built under linux
Compiled at Nov 3 2016 12:25:49
%ENV:
PERLBREW_BASHRC_VERSION="0.75"
PERLBREW_HOME="/home/chris/.perlbrew"
PERLBREW_MANPATH="/opt/perlbrew/perls/perl-5.24.0/man"
PERLBREW_PATH="/opt/perlbrew/bin:/opt/perlbrew/perls/perl-5.24.0/bin"
PERLBREW_PERL="perl-5.24.0"
PERLBREW_ROOT="/opt/perlbrew"
PERLBREW_VERSION="0.75"
@INC:
/opt/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0/x86_64-linux
/opt/perlbrew/perls/perl-5.24.0/lib/site_perl/5.24.0
/opt/perlbrew/perls/perl-5.24.0/lib/5.24.0/x86_64-linux
/opt/perlbrew/perls/perl-5.24.0/lib/5.24.0
.
---

Test case script
=====================================

use strict;
use utf8;
use Test::More tests => 26;
use Data::Dumper;

use DBI;

my $dbi=DBI->connect(
'dbi:Pg:dbname=test_db',
'chris',
'',
{
pg_enable_utf8 => 1,
}
);

my @expect=(
[ 'NAME', "ABc", "ABc" ],
[ 'NAME_uc', "ABc", "ABC" ],
[ 'NAME_lc', "ABc", "abc" ],

[ 'NAME', "てすと-ABc", "てすと-ABc" ],
[ 'NAME_uc', "てすと-Abc", "てすと-ABC" ],
[ 'NAME_uc', "てすと-Abc", "てすと-ABC" ],
[ 'NAME_lc', "てすと-Abc", "てすと-abc" ],
[ 'NAME_lc', "てすと-Abc", "てすと-abc" ],

[ 'NAME', "ÄMNE-Abc", "ÄMNE-Abc" ],
[ 'NAME_uc', "ÄMNE-Abc", "ÄMNE-ABC" ],
[ 'NAME_uc', "ämne-Abc", "ÄMNE-ABC" ],
[ 'NAME_lc', "ämne-Abc", "ämne-abc" ],
[ 'NAME_lc', "ÄMNE-Abc", "ämne-abc" ],
);

foreach my $e (@expect) {
my($case,$as,$fld)=@$e;

my $val;
if($case eq 'NAME_uc') {
$val = uc($as);
} elsif($case eq 'NAME_lc') {
$val = lc($as);
} else {
$val = $as;
}

is($val,$fld,"case-converted $as to $case");

$dbi->{FetchHashKeyName} = $case;

my $row=$dbi->selectrow_hashref(qq{ select now() as "$as" });

ok(exists $row->{$fld},"hashref $case") or diag(Dumper $row);
}


Regards,
Chris Hutchinson

Question on FetchHashKeyName (5 messages)

$
0
0
Hello All,

I have been using DBI for some years with MySQL, PostgreSQL, SQLite and Oracle. When using DBI with Oracle I always set FetchHashKeyName to NAME_lc.

Over the weekend I was prototyping a new system and I wanted to use SQLite since I was somewhat offline. All of the hash keys were lower-case by default, but the protocol I was trying to adhere to was using camelCase.

So my question is (and is has possibly been responded to before):

- Would it be possible to have FetchHashKeyName preserve case? so if a database was using camelCase this would be preserved.

Our basis datamodel is encapsulated in views for separate service/application/protocol implementations, so if I would get the views to adhere to the protocol, I would not have to translated the hash keys (and maintain the translation dictionary afterwards.

I checked some FAQ without luck (https://www.fnal.gov/docs/products/perl/pod/site_perl/DBI/FAQ.html), which however seem a bit obsolete (last update 1997) and I cannot find any trace of the FAQ on MetaCPAN.

jonasbn

pauseid: JONASBN
email: jonasbn@cpan.org
twitter: @jonasbn
blog: https://lastmover.wordpress.com/





Viewing all 225 articles
Browse latest View live