Subject: | Revision 10946, "Added support for Scrollable cursors" (included in DBD-Oracle-1.21) breaks compatibility with Oracle 8.1.7 |
Date: | Wed, 7 May 2008 17:37:29 -0400 |
To: | <bug-DBD-Oracle [...] rt.cpan.org> |
From: | "Baxter, Robert" <Robert.Baxter [...] chep.com> |
Greetings,
Revision 10946, "Added support for Scrollable cursors" (included in
DBD-Oracle-1.21) breaks compatibility with Oracle 8.1.7.
The reason why is that the defined constant "OCI_FETCH_CURRENT" is not
defined in "oci.h" in Oracle 8.1.7. This constant is not defined until
Oracle 9i.
The constant "OCI_FETCH_CURRENT" is referenced in the source file
"Oracle.c" which is generated from the source file "Oracle.xs"
This problem may be reproduced (on a system where Oracle 8.1.7 is
installed) by:
o Compiling and installing perl-5.8.8 like so:
sh Configure -Dcc=gcc -Dprefix=/some/path -Doptimize=-O0 -des
make
make install
o Compiling and installing DBI-1.604 like so:
/some/path/perl Makefile.PL
make
make install
o Attempting to compile DBD-Oracle-1.21 like so:
# Setup environment variables appropriate to your Oracle 8.1.7
installation
/some/path/perl Makefile.PL
make
The following compile error is produced on a Solaris 2.8 system using
GCC 4.2.2:
Show quoted text
> make
gcc -c -I/oracle/app/oracle/product/817/rdbms/public
-I/oracle/app/oracle/product/817/rdbms/demo
-I/oracle/app/oracle/product/817/rdbms/demo
-I/oracle/app/oracle/product/817/rdbms/public
-I/oracle/app/oracle/product/817/plsql/public
-I/oracle/app/oracle/product/817/network/public
-I/some/path/lib/perl5/site_perl/5.8.8/sun4-solaris/auto/DBI
-fno-strict-aliasing -pipe -Wdeclaration-after-statement
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O0 -DVERSION=\"1.21\"
-DXS_VERSION=\"1.21\" -fPIC
"-I/some/path/lib/perl5/5.8.8/sun4-solaris/CORE" -Wall -Wno-comment
-DUTF8_SUPPORT -DORA_OCI_VERSION=\"8.1.7.0\" -DUSE_ORA_OCI_STMNT_FETCH
Oracle.c
Oracle.c: In function 'boot_DBD__Oracle':
Oracle.c:1780: error: 'OCI_FETCH_CURRENT' undeclared (first use in this
function)
Oracle.c:1780: error: (Each undeclared identifier is reported only once
Oracle.c:1780: error: for each function it appears in.)
make: *** [Oracle.o] Error 1
One possible solution is to implement the following:
o Conditional compilation of the code using OCI_FETCH_CURRENT
depending upon whether the Oracle version is 9i or higher
o Augmenting the following code block in oci8.c to croak if the Oracle
version is not 9i or higher:
if (imp_sth->fetch_orient != OCI_DEFAULT) {
...
}
Here is my Perl and OS version info:
Show quoted text> perl -v
This is perl, v5.8.8 built for sun4-solaris
Copyright 1987-2006, Larry Wall
Perl may be copied only under the terms of either the Artistic License
or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to
the
Internet, point your browser at http://www.perl.org/, the Perl Home
Page.
Show quoted text> uname -a
SunOS hostname 5.8 Generic_117350-46 sun4u sparc SUNW,Sun-Fire-880
-AL