From: Tim Bunce
file: $CPAN/authors/id/T/TI/TIMB/DBI-1.627.tar.gz
size: 585833 bytes
md5: aab49be51b0f4867a1894145b023d2c5
The primary DBI repository is now on github under the
ownership of the "perl5-dbi" team:
https://github.com/perl5-dbi/dbi
https://github.com/perl5-dbi?tab=members
=head2 Changes in DBI 1.627 - 16th May 2013
Fixed VERSION regression in DBI::SQL::Nano [Tim Bunce]
=head2 Changes in DBI 1.626 - 15th May 2013
Fixed pod text/link was reversed in a few cases RT#85168
[H.Merijn Brand]
Handle aliasing of STORE'd attributes in DBI::DBD::SqlEngine
[Jens Rehsack]
Updated repository URI to git [Jens Rehsack]
Fixed skip() count arg in t/48dbi_dbd_sqlengine.t [Tim Bunce]
=head2 Changes in DBI 1.625 (svn r15595) 28th March 2013
Fixed heap-use-after-free during global destruction RT#75614
thanks to Reini Urban.
Fixed ignoring RootClass attribute during connect() by
DBI::DBD::SqlEngine reported in RT#84260 by Michael Schout
=head2 Changes in DBI 1.624 (svn r15576) 22nd March 2013
Fixed Gofer for hash randomization in perl 5.17.10+ RT#84146
Clarify docs for can() re RT#83207
=cut
Enjoy!
Tim.
From: Vancura, Mark D
Bruce,
Thanks very much, I do see it in the several comments, and it appears to work as well!
Thanks to Tim and then particularly Bruce for showing me the way, I do appreciate it!
So in a nutshell:
When a mysql command executed in a perl DBI do or execute method:
load data local infile 'TEMP_LOAD_DATA_7318' into table ports ;
Gives the error message:
DBD::mysql::db do failed: The used command is not allowed with this MySQL version
It is because of the special treatment of load data, explained in 6.1.6. Security Issues with LOAD DATA LOCAL
*If you use LOAD DATA LOCAL in Perl scripts or other programs that read the [client] group from option files, you can add the local-infile=1 option to that group. However, to keep this from causing problems for programs that do not understand local-infile, specify it using the loose- prefix:
[client]
loose-local-infile=1
*If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:
ERROR 1148: The used command is not allowed with this MySQL version
And the "option files" can be the dsn setup line in my perl program:
my $dsn = "DBI:mysql:database=test;host=myhost;mysql_local_infile=1;"
And then the load data local infile command will work without this error, and load the data!
I hope this helps.
Mark Vancura
LSI Corporation
-----Original Message-----
From: Bruce Johnson [mailto:johnson@pharmacy.arizona.edu]
Sent: Thursday, May 09, 2013 12:10 PM
Cc: dbi-users@perl.org (dbi-users@perl.org)
Subject: Re: (Fwd) Perl DBI question
On May 9, 2013, at 10:47 AM, "Vancura, Mark D (Mark)" <Mark.Vancura@lsi.com> wrote:
> Bruce,
> Thanks, the explanation makes sense, so I need to figure out how to
> follow through on this documented suggestion from: 6.1.6. Security
> Issues with LOAD DATA LOCAL
>
> *If you use LOAD DATA LOCAL in Perl scripts or other programs that read the [client] group from option files, you can add the local-infile=1 option to that group. However, to keep this from causing problems for programs that do not understand local-infile, specify it using the loose- prefix:
> [client]
> loose-local-infile=1
>
> *If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:
> ERROR 1148: The used command is not allowed with this MySQL version
>
> Thus this fits my situation exactly, I just have to learn where the
> "option files" are and how to put the [client] loose-local-infile=1 into it.
>
> Any suggestions where to look this up?
right there in theat section you looked at, down in the comments is
"For use in perl DBI scripts, adding an option at the end of the data source definition for DBI->connect fixes the LOAD DATA LOCAL problem in some situations...
use strict;
use DBI;
my $dsn = "DBI:mysql:mydb;mysql_local_infile=1";
my $user = "me";
my $password = "secret";
my $dbh = DBI->connect($dsn,$user,$password);"
the $dsn creation statement is where you can put a ton of options; mysql-only ones would be documented in the DBD:mysql documentation, I'll bet.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
From: Bruce Johnson
On May 9, 2013, at 10:47 AM, "Vancura, Mark D (Mark)" <Mark.Vancura@lsi.com> wrote:
> Bruce,
> Thanks, the explanation makes sense, so I need to figure out how to follow through
> on this documented suggestion from: 6.1.6. Security Issues with LOAD DATA LOCAL
>
> *If you use LOAD DATA LOCAL in Perl scripts or other programs that read the [client] group from option files, you can add the local-infile=1 option to that group. However, to keep this from causing problems for programs that do not understand local-infile, specify it using the loose- prefix:
> [client]
> loose-local-infile=1
>
> *If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:
> ERROR 1148: The used command is not allowed with this MySQL version
>
> Thus this fits my situation exactly, I just have to learn where the "option files" are
> and how to put the [client] loose-local-infile=1 into it.
>
> Any suggestions where to look this up?
right there in theat section you looked at, down in the comments is
"For use in perl DBI scripts, adding an option at the end of the data source definition for DBI->connect fixes the LOAD DATA LOCAL problem in some situations...
use strict;
use DBI;
my $dsn = "DBI:mysql:mydb;mysql_local_infile=1";
my $user = "me";
my $password = "secret";
my $dbh = DBI->connect($dsn,$user,$password);"
the $dsn creation statement is where you can put a ton of options; mysql-only ones would be documented in the DBD:mysql documentation, I'll bet.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
From: Vancura, Mark D
Bruce,
Thanks, the explanation makes sense, so I need to figure out how to follow through
on this documented suggestion from: 6.1.6. Security Issues with LOAD DATA LOCAL
*If you use LOAD DATA LOCAL in Perl scripts or other programs that read the [client] group from option files, you can add the local-infile=1 option to that group. However, to keep this from causing problems for programs that do not understand local-infile, specify it using the loose- prefix:
[client]
loose-local-infile=1
*If LOAD DATA LOCAL is disabled, either in the server or the client, a client that attempts to issue such a statement receives the following error message:
ERROR 1148: The used command is not allowed with this MySQL version
Thus this fits my situation exactly, I just have to learn where the "option files" are
and how to put the [client] loose-local-infile=1 into it.
Any suggestions where to look this up?
Thanks again for your help with this!
Mark Vancura
-----Original Message-----
From: Bruce Johnson [mailto:johnson@pharmacy.arizona.edu]
Sent: Thursday, May 09, 2013 11:26 AM
To: dbi-users@perl.org (dbi-users@perl.org)
Subject: Re: (Fwd) Perl DBI question
On May 9, 2013, at 9:37 AM, Tim.Bunce@pobox.com wrote:
>
> However, then I want to put data into it, with a command like the following:
>
>
>
> load data local infile 'TEMP_LOAD_DATA_26021' into table ports ;
>
>
>
> And I get:
>
> DBD::mysql::db do failed: The used command is not allowed with this MySQL version at
> read_excel_write_mysql.pl line 140.
I find this in the MySQL docs:
"If the statement fails, it is likely that your MySQL installation does not have local file capability enabled by default. See Section 6.1.6, "Security Issues with LOAD DATA LOCAL", for information on how to change this."
<http://dev.mysql.com/doc/refman/5.0/en/loading-tables.html>
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
From: Tim.Bunce@pobox.com
----- Forwarded message from "Vancura, Mark D (Mark)" <Mark.Vancura@lsi.com> -----
Date: Thu, 9 May 2013 11:05:37 -0400
From: "Vancura, Mark D (Mark)" <Mark.Vancura@lsi.com>
To: "Tim.Bunce@pobox.com" <Tim.Bunce@pobox.com>
Subject: Perl DBI question
Tim,
I am newly trying to make Perl and DBI work with mysql, with some success, e.g. I have been
able to get connected, accessing a database, and create a table in it, with this command:
MySQL_command = create table ports (
PortName varchar(40),
direction enum('input','output','inout'),
digital_analog enum('digital','analog'),
port_pad enum('port','pad'),
powerSupplies varchar(20) ) ;
executed create table command
However, then I want to put data into it, with a command like the following:
load data local infile 'TEMP_LOAD_DATA_26021' into table ports ;
And I get:
DBD::mysql::db do failed: The used command is not allowed with this MySQL version at
read_excel_write_mysql.pl line 140.
DBD::mysql::db do failed: The used command is not allowed with this MySQL version at
read_excel_write_mysql.pl line 140.
Whether I "do" it or "prepare" and then "execute" it.
If I run /usr/bin/mysql interactively, these commands are completely successful, so it hardly seems like
a "MySQL version" issue.
But I also have not been able to find that message in any of the DBI/DBD code, thus I suspect part of it
is coming from MySQL.
Is there some permission issue related to "Load data local infile" that I can/must manage. I am
currently running as the "root" of
mysql, and thus I expect I have, or can get any permission necessary.
Thanks for any help you can provide.
Mark Vancura
LSI Corporation.
----- End forwarded message -----
From: Tim Bunce
On Wed, May 08, 2013 at 10:58:02AM -0700, felix@crowfix.com wrote:
> On Wed, May 08, 2013 at 09:43:27AM -0700, Bill Ward wrote:
> > Cool. That whole scalar vs list context thing is one of Perl's biggest
> > strengths, but also one of its biggest weaknesses (in that it is a common
> > source of bugs like this). When you see head-scratching problems, it's one
> > of the first things to look for.
>
> Just guessing here, not familiar with the particular code in question.
> But I have been bitten a few times by code which returns false in the
> 'proper' manner
>
> return;
>
> instead of forcing a scalar return
>
> return undef;
>
> or list return
>
> return ();
There is no difference between "return;" and "return ();".
Both return an empty list when called in list context
and an undef when called in scalar context.
The "return ();" style does serve as a reminder to the reader.
> Is that what's going on here -- the original code imparted a list
> context, which triggered another perl gotcha, whereby missing list
> values simply disappear:
>
> scalar(1,2,,4,,6) ---> 4, not 6
That returns 6, or rather, it returns whatever happens to be the last value.
Tim.
From: felix
On Wed, May 08, 2013 at 06:22:09PM -0700, James Marshall wrote:
> It shows 6 because a comma-separated literal list, when interpreted as a
> scalar, evaluates to the final value in the list, not the length of the
> list. If you evaluate "scalar(1,2,,4,,7)", it will equal 7. That's the
> comma operator at work-- even though it looks like a list (and both use
> commas), it's really just a sequential set of expressions.
I think I've forgotten more useless perl trivia than I should have...
I use the comma operator sometimes, but never inside scalar(). Didn't
recognize it. TMTOWTMakeAMess.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
From: James Marshall
It shows 6 because a comma-separated literal list, when interpreted as a
scalar, evaluates to the final value in the list, not the length of the
list. If you evaluate "scalar(1,2,,4,,7)", it will equal 7. That's the
comma operator at work-- even though it looks like a list (and both use
commas), it's really just a sequential set of expressions.
Cheers,
James
On Wed, May 8, 2013 at 5:14 PM, <felix@crowfix.com> wrote:
> On Wed, May 08, 2013 at 02:04:37PM -0400, Derek Jones wrote:
> > Huh?
> >
> > That produces 6 - as it should. What version of Perl are you working
> with?
>
> > On May 8, 2013, at 1:58 PM, felix@crowfix.com wrote:
> >
> > > scalar(1,2,,4,,6)
>
> You are right -- but this produces 4 first, as I had always thought it
> would, and then 6, as I don't quite understand. I would never use
> that kind of expression, and I sorta maybe understand why it says 6,
> but only in hindsight.
>
> #!/usr/bin/perl
>
> my @ary = (1,2,,4,,6);
> print "Step 1: ", scalar(@ary), "\n";
> print "Step 2: ", scalar(1,2,,4,,6), "\n";
>
> --
> ... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
> Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
> GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license
> #4933
> I've found a solution to Fermat's Last Theorem but I see I've run out of
> room o
>
From: felix
On Wed, May 08, 2013 at 02:04:37PM -0400, Derek Jones wrote:
> Huh?
>
> That produces 6 - as it should. What version of Perl are you working with?
> On May 8, 2013, at 1:58 PM, felix@crowfix.com wrote:
>
> > scalar(1,2,,4,,6)
You are right -- but this produces 4 first, as I had always thought it
would, and then 6, as I don't quite understand. I would never use
that kind of expression, and I sorta maybe understand why it says 6,
but only in hindsight.
#!/usr/bin/perl
my @ary = (1,2,,4,,6);
print "Step 1: ", scalar(@ary), "\n";
print "Step 2: ", scalar(1,2,,4,,6), "\n";
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
From: Chad Wallace
On Wed, 8 May 2013 09:30:18 -0700
Bill Ward <bill@wards.net> wrote:
> My guess is that get_value() is returning an empty array rather than
> an undef scalar when the values are null. Try copying each one to a
> scalar variable and including the list of variables in the execute().
> It'd be more readable that way anyway. Or if you must put them all
> one one line like this, add the scalar() function on each argument.
I use this idiom:
... get_value(...) || undef, ...get_value(...) || undef, ...
If you don't want undef, you can use "|| ''" or "|| 0" instead.
> On Wed, May 8, 2013 at 9:18 AM, Bruce Johnson
> <johnson@pharmacy.arizona.edu>wrote:
>
> > Getting the error:
> >
> > DBD::Oracle::st execute failed: called with 3 bind variables when 4
> > are needed [for Statement "insert into employee_fte_annualrate_l
> > (emplid, emptype_cd, fte, annual_rate) values(?,?,?,?)" with
> > ParamValues: :p1='22057713', :p2='R', :p3='1', :p4='47311']
> > at /home/oraweb/perl/frs/ kfsupdate.pl line 64, <DATA> line 581.
> >
> > I'm pretty sure I count 4 placeholders and 4 parameter values in
> > that error message, so where is the '3 bind variables' coming from?
> >
> > here's the cursor definition:
> >
> > my $csr_emp_info = $lda->prepare("insert into
> > employee_fte_annualrate_l (emplid, emptype_cd, fte, annual_rate)
> > values(?,?,?,?)");
> >
> > I'm pulling the data from an LDAP query, here's the offending line
> > 64 (where $mesg is the returned LDAP object):
> >
> > $csr_emp_info->execute($mesg->entry($n)->get_value('emplId'),
> > $mesg->entry($n)->get_value('employeeType'),$mesg->entry($n)->get_value('employeeFTE'),$mesg->entry($n)->get_value('employeeTotalAnnualRate'));
> >
> > All the columns allow null entries, and these are all single-valued
> > entries in the LDAP schema.
> >
> >
> > --
> > Bruce Johnson
> > University of Arizona
> > College of Pharmacy
> > Information Technology Group
> >
> > Institutions do not have opinions, merely customs
> >
> >
> >
>
>
--
C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0
From: Bruce Johnson
On May 8, 2013, at 10:58 AM, felix@crowfix.com wrote:
>
> Is that what's going on here -- the original code imparted a list
> context, which triggered another perl gotcha, whereby missing list
> values simply disappear:
>
And I remember now the reason the error message is confusing, I'll bet that was an actual bug I discovered in (iirc) DBI or DBD::Oracle which was fixed, but not on this particular server, because we're still constrained to running a very old version for various reasons. The error message actually displays the values for the last successful insert not the one that failed.
Mystery now solved.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
From: felix
On Wed, May 08, 2013 at 09:43:27AM -0700, Bill Ward wrote:
> Cool. That whole scalar vs list context thing is one of Perl's biggest
> strengths, but also one of its biggest weaknesses (in that it is a common
> source of bugs like this). When you see head-scratching problems, it's one
> of the first things to look for.
Just guessing here, not familiar with the particular code in question.
But I have been bitten a few times by code which returns false in the
'proper' manner
return;
instead of forcing a scalar return
return undef;
or list return
return ();
Is that what's going on here -- the original code imparted a list
context, which triggered another perl gotcha, whereby missing list
values simply disappear:
scalar(1,2,,4,,6) ---> 4, not 6
I understand and appreciate most of Perl's little tricks, but they
sometimes catch me by surprise and elicit a few curses while debugging.
--
... _._. ._ ._. . _._. ._. ___ .__ ._. . .__. ._ .. ._.
Felix Finch: scarecrow repairman & rocket surgeon / felix@crowfix.com
GPG = E987 4493 C860 246C 3B1E 6477 7838 76E9 182E 8151 ITAR license #4933
I've found a solution to Fermat's Last Theorem but I see I've run out of room o
From: Bruce Johnson
Getting the error:
DBD::Oracle::st execute failed: called with 3 bind variables when 4 are needed [for Statement "insert into employee_fte_annualrate_l (emplid, emptype_cd, fte, annual_rate) values(?,?,?,?)" with ParamValues: :p1='22057713', :p2='R', :p3='1', :p4='47311'] at /home/oraweb/perl/frs/kfsupdate.pl line 64, <DATA> line 581.
I'm pretty sure I count 4 placeholders and 4 parameter values in that error message, so where is the '3 bind variables' coming from?
here's the cursor definition:
my $csr_emp_info = $lda->prepare("insert into employee_fte_annualrate_l (emplid, emptype_cd, fte, annual_rate) values(?,?,?,?)");
I'm pulling the data from an LDAP query, here's the offending line 64 (where $mesg is the returned LDAP object):
$csr_emp_info->execute($mesg->entry($n)->get_value('emplId'), $mesg->entry($n)->get_value('employeeType'),$mesg->entry($n)->get_value('employeeFTE'),$mesg->entry($n)->get_value('employeeTotalAnnualRate'));
All the columns allow null entries, and these are all single-valued entries in the LDAP schema.
--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group
Institutions do not have opinions, merely customs
From: Jens Rehsack
On 08.05.13 00:05, Tim Bunce wrote:
[...]
> At this stage in the life of the DBI I think it's reasonable to assume
> that there isn't a leak in the DBI itself. If there was then a lot of
> people would be affected and complaining about it.
I think this assumption is heavily wrong. From my jobs I learned one
thing the last years: do it quick. To illustrate what I mean saying
that, see following exampple.
In a particular project we had the issue, that every monday morning
our web-interface was inoperable because of an invalid $dbh (which
was cached). The question from our manager was: can you say in 10
minutes why and how to fix and can you guarantee fix it until lunch?
Otherwise - implement a cron controlled web-server restart each
morning at 5.
Because of personal interests I debugged later into it (and fixed
it a few weeks later - "guaranteed") ...
What I'm trying to say - when administrators see there web-server
machines running out of memory, the implement a scheduled restart
in the pool of machines.
I really don't know business relying on web-services running
qualified monitoring with performance measurement (some do, but
don't know what they measure and finally one company really does).
Sorry for complaining ;)
Cheers
--
Jens Rehsack
From: Anoop Kumar Paramesweran
Hi Support,
DBI has been successfully installed after the instaltion of XLC trail version..Now I am facing issue with DBD-oracle..
I was trying to install DBD module but I receve the errors
bash-3.2# perl Makefile.PL
Using DBI 1.625 (for perl 5.010001 on aix-thread-multi) installed in /usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi/auto/DBI/
Configuring DBD::Oracle for perl 5.010001 on aix (aix-thread-multi)
Remember to actually *READ* the README file! Especially if you have any problems.
Trying to find an ORACLE_HOME
Your LIBPATH env var is set to ''
The ORACLE_HOME environment variable is not set and I couldn't guess it.
It must be set to hold the path to an Oracle installation directory
on this machine (or a machine with a compatible architecture).
See the appropriate README file for your OS for more information.
ABORTED!
================================================
After this I set the path
export ORACLE_BASE=/u01/app/oracle/product
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export SHLIB_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:/usr/bin:/etc:/usr/bin/x11:/usr/local/bin:/usr/vacpp/bin:$PATH
export ORACLE_SID=
Then I receive these errors
==================================================================
bash-3.2# perl Makefile.PL
Using DBI 1.625 (for perl 5.010001 on aix-thread-multi) installed in /usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi/auto/DBI/
Configuring DBD::Oracle for perl 5.010001 on aix (aix-thread-multi)
Remember to actually *READ* the README file! Especially if you have any problems.
Installing on a aix, Ver#5.3
Using Oracle in /u01/app/oracle/product/11.2.0/dbhome_1
DEFINE _SQLPLUS_RELEASE = "1102000300" (CHAR)
Oracle version 11.2.0.3 (11.2)
Found /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk
Using /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk
Your LIBPATH env var is set to ''
WARNING: Your LIBPATH env var doesn't include '/u01/app/oracle/product/11.2.0/dbhome_1/lib' but probably needs to.
Reading /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk
Reading /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/env_rdbms.mk
Deleting -b64 from COMPOBJS because -b64 doesn't exist.
WARNING: Oracle /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ins_rdbms.mk doesn't define a 'build' rule.
WARNING: I will now try to guess how to build and link DBD::Oracle for you.
This kind of guess work is very error prone and Oracle-version sensitive.
It is possible that it won't be supported in future versions of DBD::Oracle.
*PLEASE* notify dbi-users about exactly _why_ you had to build it this way.
Found header files in /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/public.
client_version=11.2
DEFINE= -DUTF8_SUPPORT -DORA_OCI_VERSION=\"11.2.0.3\" -DORA_OCI_102 -DORA_OCI_112
Checking for functioning wait.ph
System: perl5.010001 aix dennis01 3 5 00c72e9a4c00
Compiler: xlc_r -q32 -O -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -qlanglvl=extended -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong
Linker: /usr/bin/ld
Sysliblist: /lib/crt0_64.o -ldl -lc -lm -lpthreads -lodm -lbsd_r -lld -lperfstat
Oracle makefiles would have used these definitions but we override them:
CC: $(ORACLE_HOME)/bin/oraxlc $(ORAXLCFLAGS)
CFLAGS: $(GFLAG) $(OPTIMIZE) $(CDEBUG) $(CCFLAGS) $(PFLAGS)\
$(SHARED_CFLAG) $(USRFLAGS)
[$(GFLAG) -O3 $(CDEBUG) -q64 -DSS_64BIT_SERVER -qwarn64 -qinfo=uni -DAIXRIOS -qflag=s:s -I/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/demo -I/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/public -I/u01/app/oracle/product/11.2.0/dbhome_1/plsql/public -I/u01/app/oracle/product/11.2.0/dbhome_1/network/public -DLDAP_CM $(LPFLAGS) $(PLSQLNCGFLAGS) $(USRFLAGS)]
LDFLAGS: -o $@ $(LDPATHFLAG)$(PRODLIBHOME) $(LDPATHFLAG)$(LIBHOME)
[-o $@ -L/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib/ -L$(LIBHOME)]
Linking with /lib/crt0_64.o -lclntsh -brtl -lld -lm -ldl -lc -lm -lpthreads -lodm -lbsd_r -lld -lperfstat -lm -lpthreads [from $(OCISHAREDLIBS)]
WARNING: You will may need to rebuild perl using the xlc_r compiler.
The important thing is that perl and DBD::Oracle be built with the same compiler.
You may also need to: ORACCENV='cc=xlc_r'; export ORACCENV
Also see README.aix for gcc instructions and read about the -p option.
Checking if your kit is complete...
Looks good
Unrecognized argument in LIBS ignored: '-brtl'
LD_RUN_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib:/u01/app/oracle/product/11.2.0/dbhome_1/rdbms/lib
Using DBD::Oracle 1.62.
Using DBD::Oracle 1.62.
Using DBI 1.625 (for perl 5.010001 on aix-thread-multi) installed in /usr/opt/perl5/lib/site_perl/5.10.1/aix-thread-multi/auto/DBI/
Writing Makefile for DBD::Oracle
*** 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?)
bash-3.2#
Thanks for the replay ,I think we don't have xlc.. but in software listing its showing ..but I cannot find the binaries for it.
I have already gcc but it says most of the option are not available with gcc..
Anoop Kumar Paramesweran | Expert - Unix and Storage Systems
e anoop.kumar@nawras.om | m +96895103659 twitter/nawras_oman | facebook/nawras -----Original Message-----
From: Martin J. Evans [mailto:bohica@ntlworld.com]
Sent: Wednesday, May 01, 2013 11:07 PM
To: dbi-users@perl.org
Cc: Anoop Kumar Paramesweran
Subject: Re: DBI Module installtion
On 29/04/2013 14:55, Anoop Kumar Paramesweran wrote:
> Hi Support,
>
> I am receiving below error while installing (make ) DBI module in my
> AIX box. As I am new to Perl installations could you please help me to
> solve this..
>
> xlc_r -q32 -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
> -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT
> -qlanglvl=extended -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong
> -O -DVERSION=\"1.625\" -DXS_VERSION=\"1.625\"
> "-I/usr/opt/perl5/lib/5.10.1/aix-thread-multi/CORE" Perl.c
> /bin/sh: xlc_r: not found.
> make: 1254-004 The error code from the last command is 127.
>
>
> Stop.
The Perl you are using was compiled with the AIX C compiler and it is either a) not installed or b) it is not on your path.
You can either:
a) add the AIX compiler xlc_r to your path if you have it installed (you usually have to pay IBM for this compiler)
b) install the IBM compiler and add it to your PATH.
c) install another compiler such as gcc (which is free), build Perl yourself into some dir you can point your PATH at and then install DBI.
You might find perlbrew useful if you end up here.
Mostly when people report the issue you have they have installed Perl from a package provided by IBM that they built with their compiler and you don't have this compiler. When Perl is built is records the compiler and options used and generally you cannot compile Perl itself with one compiler and then modules which require a C compiler with another compiler.
Martin
--
Martin J. Evans
Wetherby, UK
This e-mail including any attachment is intended only for the recipient(s) named. It may contain confidential information and should not be read, copied or otherwise used by any other person. If you are not a named recipient, please contact the sender and delete the e-mail from your system. The sender does not accept any liability for errors or omissions in the content of this message or for viruses, or any damage due to the e-mail. The recipient is advised to have appropriate virus check software
From: Garry T. Williams
On 5-2-13 15:20:23 David E. Wheeler wrote:
> This query:
>
> $dbh->selectrow_hashref(q{
> SELECT c.change_id
> , COLLECT(t.tag) AS tags
> FROM changes c
> LEFT JOIN tags t ON c.change_id = t.change_id
> WHERE c.project = ?
> GROUP BY c.change_id
> }, undef, 'engine');
>
> Generates this (useless) exception:
>
> ORA-00932: inconsistent datatypes: expected - got - (DBD ERROR:
> error possibly near <*> indicator at char 51 in '
Perhaps this is due to
http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions031.htm#SQLRF06304
"COLLECT is an aggregate function that takes as its argument a
column of any type and creates a nested table of the input type
out of the rows selected. To get accurate results from this
function you must use it within a CAST function."
Do you have to define a type and cast COLLECT() to that type?
--
Garry T. Williams
From: Anoop Kumar Paramesweran
Thanks for the replay ,I think we don't have xlc.. but in software listing its showing ..but I cannot find the binaries for it.
I have already gcc but it says most of the option are not available with gcc..
Anoop Kumar Paramesweran | Expert - Unix and Storage Systems
e anoop.kumar@nawras.om | m +96895103659
twitter/nawras_oman | facebook/nawras
-----Original Message-----
From: Martin J. Evans [mailto:bohica@ntlworld.com]
Sent: Wednesday, May 01, 2013 11:07 PM
To: dbi-users@perl.org
Cc: Anoop Kumar Paramesweran
Subject: Re: DBI Module installtion
On 29/04/2013 14:55, Anoop Kumar Paramesweran wrote:
> Hi Support,
>
> I am receiving below error while installing (make ) DBI module in my
> AIX box. As I am new to Perl installations could you please help me to
> solve this..
>
> xlc_r -q32 -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
> -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT
> -qlanglvl=extended -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong
> -O -DVERSION=\"1.625\" -DXS_VERSION=\"1.625\"
> "-I/usr/opt/perl5/lib/5.10.1/aix-thread-multi/CORE" Perl.c
> /bin/sh: xlc_r: not found.
> make: 1254-004 The error code from the last command is 127.
>
>
> Stop.
The Perl you are using was compiled with the AIX C compiler and it is either a) not installed or b) it is not on your path.
You can either:
a) add the AIX compiler xlc_r to your path if you have it installed (you usually have to pay IBM for this compiler)
b) install the IBM compiler and add it to your PATH.
c) install another compiler such as gcc (which is free), build Perl yourself into some dir you can point your PATH at and then install DBI.
You might find perlbrew useful if you end up here.
Mostly when people report the issue you have they have installed Perl from a package provided by IBM that they built with their compiler and you don't have this compiler. When Perl is built is records the compiler and options used and generally you cannot compile Perl itself with one compiler and then modules which require a C compiler with another compiler.
Martin
--
Martin J. Evans
Wetherby, UK
This e-mail including any attachment is intended only for the recipient(s) named. It may contain confidential information and should not be read, copied or otherwise used by any other person. If you are not a named recipient, please contact the sender and delete the e-mail from your system. The sender does not accept any liability for errors or omissions in the content of this message or for viruses, or any damage due to the e-mail. The recipient is advised to have appropriate virus check software
From: David E. Wheeler
Fellow DBIers,
This query:
$dbh->selectrow_hashref(q{
SELECT c.change_id
, COLLECT(t.tag) AS tags
FROM changes c
LEFT JOIN tags t ON c.change_id = t.change_id
WHERE c.project = ?
GROUP BY c.change_id
}, undef, 'engine');
Generates this (useless) exception:
ORA-00932: inconsistent datatypes: expected - got - (DBD ERROR: error possibly near <*> indicator at char 51 in '
SELECT c.change_id
, <*>COLLECT(t.tag) AS tags
FROM changes c
LEFT JOIN tags t ON c.change_id = t.change_id
WHERE c.project = :p1
GROUP BY c.change_id
')
However, I can make the error go away by removing the use of placeholders. This version does not throw an error:
$dbh->selectrow_hashref(q{
SELECT c.change_id
, COLLECT(t.tag) AS tags
FROM changes c
LEFT JOIN tags t ON c.change_id = t.change_id
WHERE c.project = 'engine'
GROUP BY c.change_id
});
I can also eliminate the error by removing the COLLECT() line, but I really want an array there. Curiously, the error also goes away if I first execute without a placeholder and then with. IOW, this does not error out, either:
$dbh->selectrow_hashref(q{
SELECT c.change_id
, COLLECT(t.tag) AS tags
FROM changes c
LEFT JOIN tags t ON c.change_id = t.change_id
WHERE c.project = 'engine'
GROUP BY c.change_id
});
$dbh->selectrow_hashref(q{
SELECT c.change_id
, COLLECT(t.tag) AS tags
FROM changes c
LEFT JOIN tags t ON c.change_id = t.change_id
WHERE c.project = ?
GROUP BY c.change_id
}, undef, 'engine');
WTF Oracle?
Thanks,
David
From: John R Pierce
On 4/29/2013 6:55 AM, Anoop Kumar Paramesweran wrote:
>
> Hi Support,
>
> I am receiving below error while installing (make ) DBI module in my
> AIX box. As I am new to Perl installations could you please help me to
> solve this..
>
> xlc_r -q32 -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
> -qmaxmem=-1 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT
> -qlanglvl=extended -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong
> -O -DVERSION=\"1.625\" -DXS_VERSION=\"1.625\"
> "-I/usr/opt/perl5/lib/5.10.1/aix-thread-multi/CORE" Perl.c
> /bin/sh: xlc_r: not found.
> make: 1254-004 The error code from the last command is 127.
>
you don't have the IBM XLC compiler in your path. this is a commercial
product ($$) and if you have it installed, its default path is generally
/usr/vac/bin or /usr/vacpp/bin
--
john r pierce 37N 122W
somewhere on the middle of the left coast
From: Martin J. Evans
On 29/04/2013 14:55, Anoop Kumar Paramesweran wrote:
> Hi Support,
>
> I am receiving below error while installing (make ) DBI module in my AIX
> box. As I am new to Perl installations could you please help me to solve
> this..
>
> xlc_r -q32 -c -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1
> -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -qlanglvl=extended
> -I/usr/local/include -q32 -D_LARGE_FILES -qlonglong -O
> -DVERSION=\"1.625\" -DXS_VERSION=\"1.625\"
> "-I/usr/opt/perl5/lib/5.10.1/aix-thread-multi/CORE" Perl.c
> /bin/sh: xlc_r: not found.
> make: 1254-004 The error code from the last command is 127.
>
>
> Stop.
The Perl you are using was compiled with the AIX C compiler and it is
either a) not installed or b) it is not on your path.
You can either:
a) add the AIX compiler xlc_r to your path if you have it installed (you
usually have to pay IBM for this compiler)
b) install the IBM compiler and add it to your PATH.
c) install another compiler such as gcc (which is free), build Perl
yourself into some dir you can point your PATH at and then install DBI.
You might find perlbrew useful if you end up here.
Mostly when people report the issue you have they have installed Perl
from a package provided by IBM that they built with their compiler and
you don't have this compiler. When Perl is built is records the compiler
and options used and generally you cannot compile Perl itself with one
compiler and then modules which require a C compiler with another compiler.
Martin
--
Martin J. Evans
Wetherby, UK
From: Jens Rehsack
On 23.04.13 01:19, Sunil Palepu wrote:
> Hi -
++
> We had installed DBI on the AIX server but unable to install DBD::Teradata on the same server. My Unix admin is seeing "Memory fault(coredump)" error and wondering if someone can help me out. I did install this on the Linux servers in the past but this is my first time installing DBI on AIX.
How did you install that DBI?
Which compiler did you use? Which compiler flags.
Did you modify the system perl (read: where is DBI installed?)
or used local::lib?
> OS : AIX
> Perl version is : v5.8.8
> DBI version : DBI-1.625
> DBD version : DBD-Teradata-1.52
>
>
> $ sudo perl Makefile.PL
>
> *** Configuring DBD::Teradata (feature-limited free edition)...
>
> ***************************************************************
> *
> * !!!NOTE TO INSTALLERS!!!
> *
> * DBD::Teradata will be built using the following
> * directives:
> * Libraries: -L/usr/lib -lcliv2 -lnet -lsocket -lresolv -ltdusr.so
> * Include files:
> * Compile flags: -D__error_t_defined=1
> *
> * If your CLI2 libraries and/or include files are in another
> * location, please update the TDAT_DBD_CLI_LIB and
> * TDAT_DBD_CLI_INC environment variables before running
> * Makefile.PL.
> *
> ***************************************************************
>
> Memory fault(coredump)
You should probably trace where it crashes - and you should NEVER run
Makefile.PL as root.
> Thanks in advance
' welcome
Cheers
--
Jens Rehsack
From: Chad Wallace
On Sun, 28 Apr 2013 15:30:05 -1000
syed khalid <syedk@pacificloud.com> wrote:
> 2.The code that is failing on the install is this.....
>
> #*----------------------------
> -----------------------------
> #*- Create a database after checking if it exists
> #*---------------------------------------------------------
> sub create_db
> {
> my ($dbname, $userid, $pass) = @_;
>
> #*-- check for a duplicate db
> ----->> my $dbh =
> DBI->connect("DBI:mysql:mysql:localhost:3306","$userid","$pass");
> my @dbs = $dbh->func('_ListDBs');
> foreach my $db (@dbs)
> { if ($db eq $dbname) { $dbh->disconnect(); return(); } }
>
> #*-- create the db
> $dbh->do("create database $dbname"); $dbh->disconnect();
> return();
> }
>
> The error I am getting is this Line 138 refers to the ---------> line
> above)
>
>
> DBI connect('mysql:localhost:3306'
> ,'root',...) failed: Access
> denied
> for user 'root'@'localhost' (using password: NO) at ../TextMine/DbCall.pm line 138
^^^^^^^^^^^^^^^^^^
This means you didn't give a password. I can see that you do pass
"$pass" to the DBI->connect() call above, so it must be that $pass is
being passed a blank value when your sub create_db() is called. You
should look at the code that calls that function to find why it passes
a blank value.
--
C. Chad Wallace, B.Sc.
The Lodging Company
http://www.lodgingcompany.com/
OpenPGP Public Key ID: 0x262208A0
From: mnhan
> I apologize if this is not the right forum to ask question.
>
> Background
> =========
>
> I am running Ubuntu 12.04 on my laptop. it is the desktop version.
>
> I am aslo running MYSQL server version 5.5.29
>
> I am running into some problems which seem fairly basic and could be
> related to one or both of the following:
>
> 1. It looks like if I specify the "h" flag things work. However, if I use
> "root@localhost", I run into problems.
>
> syedk@syedk-ThinkPad-T410:~$ mysql -uroot -hlocalhost -p mysql
> Enter password:
> Reading table information for completion of table and column names
> You can turn off this feature to get a quicker startup with -A
>
> ********does not work for root@localhost (for some reason appends
> localhost)
>
> mysql -uroot@localhost -p
> Enter password:
> ERROR 1045 (28000): Access denied for user 'root@localhost'@'localhost'
> (using password: YES)
If you are using mysql to connect to the db on the localhost then this is
not a valid syntax, please read the manual. mysql is not ssh. It does
not take the @localhost after the username to connect to a host. If you
do not specify a -h is assumes that you are connecting to localhost, so it
appends that for you. That is why you are getting @localhost 2x.
>
> 2.The code that is failing on the install is this.....
>
> #*----------------------------
> -----------------------------
> #*- Create a database after checking if it exists
> #*---------------------------------------------------------
> sub create_db
> {
> my ($dbname, $userid, $pass) = @_;
>
> #*-- check for a duplicate db
> ----->> my $dbh =
> DBI->connect("DBI:mysql:mysql:localhost:3306","$userid","$pass");
> my @dbs = $dbh->func('_ListDBs');
> foreach my $db (@dbs)
> { if ($db eq $dbname) { $dbh->disconnect(); return(); } }
>
> #*-- create the db
> $dbh->do("create database $dbname"); $dbh->disconnect();
> return();
> }
>
> The error I am getting is this Line 138 refers to the ---------> line
> above)
>
>
> DBI connect('mysql:localhost:3306'
> ,'root',...) failed: Access
> denied
> for user 'root'@'localhost' (using password: NO) at
> ../TextMine/DbCall.pm line 138
> Can't call method "func" on an undefined value at
> ../TextMine/DbCall.pm line 139.
>
> My mysql may not have all the options loaded?? I loaded DBI but may need
> DBD. Also my databases only have this
>
> mysql> show databases
> -> ;
> +--------------------+
> | Database |
> +--------------------+
> | information_schema |
> | test |
> +--------------------+
> 2 rows in set (0.00 sec)
>
Did you run the mysql_install_db script after installation? the mysql db
for storing user and database information does not appear to be here.
Since its not here, you can't connect to it via dbi. Try specifying test
instead of mysql as the database name in your dsn.
Michael
From: syed khalid
I apologize if this is not the right forum to ask question.
Background
=========
I am running Ubuntu 12.04 on my laptop. it is the desktop version.
I am aslo running MYSQL server version 5.5.29
I am running into some problems which seem fairly basic and could be
related to one or both of the following:
1. It looks like if I specify the "h" flag things work. However, if I use
"root@localhost", I run into problems.
syedk@syedk-ThinkPad-T410:~$ mysql -uroot -hlocalhost -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2499
Server version: 5.5.29-0ubuntu0.12.04.2 (Ubuntu)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input
statement.
********does not work for root@localhost (for some reason appends
localhost)
mysql -uroot@localhost -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root@localhost'@'localhost'
(using password: YES)
2.The code that is failing on the install is this.....
#*----------------------------
-----------------------------
#*- Create a database after checking if it exists
#*---------------------------------------------------------
sub create_db
{
my ($dbname, $userid, $pass) = @_;
#*-- check for a duplicate db
----->> my $dbh =
DBI->connect("DBI:mysql:mysql:localhost:3306","$userid","$pass");
my @dbs = $dbh->func('_ListDBs');
foreach my $db (@dbs)
{ if ($db eq $dbname) { $dbh->disconnect(); return(); } }
#*-- create the db
$dbh->do("create database $dbname"); $dbh->disconnect();
return();
}
The error I am getting is this Line 138 refers to the ---------> line above)
DBI connect('mysql:localhost:3306'
,'root',...) failed: Access
denied
for user 'root'@'localhost' (using password: NO) at
../TextMine/DbCall.pm line 138
Can't call method "func" on an undefined value at
../TextMine/DbCall.pm line 139.
My mysql may not have all the options loaded?? I loaded DBI but may need
DBD. Also my databases only have this
mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| test |
+--------------------+
2 rows in set (0.00 sec)
--
*Syed Khalid*
**
*CEO*
**
*Pacific Cloud*
**
*1-408-655-1096*
From: Simon Wistow
We're using MySQL Cluster and get errors like
DBD::mysql::st execute failed: Got temporary error 1218 'Send Buffers
overloaded in NDB kernel' from NDBCLUSTER at
/usr/local/share/perl/5.10.1/Data/ObjectDriver/Driver/DBI.pm line 161.
Pretty frequently. Since most of these errors are temporary we should
probably retry them but I'm not sure whether there's any established
best practice for this, especially within transactions. Should we retry
the individual statement or retry the whole transaction?
There's this module
http://search.cpan.org/~bduggan/DBIx-TryAgain-0.05/lib/DBIx/TryAgain.pm
and I'm wondering if anyone's used it in anger.
For what it's worth these are the temporary errors we get
270 'Transaction aborted due to node shutdown'
1218 'Send Buffers overloaded in NDB kernel'
4010 'Node failure caused abort of transaction'
4028 'Node failure caused abort of transaction'
4119 'Simple/dirty read failed due to node failure'"
Simon
From: Sunil Palepu
Hi -
We had installed DBI on the AIX server but unable to install DBD::Teradata on the same server. My Unix admin is seeing "Memory fault(coredump)" error and wondering if someone can help me out. I did install this on the Linux servers in the past but this is my first time installing DBI on AIX.
OS : AIX
Perl version is : v5.8.8
DBI version : DBI-1.625
DBD version : DBD-Teradata-1.52
$ sudo perl Makefile.PL
*** Configuring DBD::Teradata (feature-limited free edition)...
***************************************************************
*
* !!!NOTE TO INSTALLERS!!!
*
* DBD::Teradata will be built using the following
* directives:
* Libraries: -L/usr/lib -lcliv2 -lnet -lsocket -lresolv -ltdusr.so
* Include files:
* Compile flags: -D__error_t_defined=1
*
* If your CLI2 libraries and/or include files are in another
* location, please update the TDAT_DBD_CLI_LIB and
* TDAT_DBD_CLI_INC environment variables before running
* Makefile.PL.
*
***************************************************************
Memory fault(coredump)
Thanks in advance
Sunil