Author: byterock
Date: Fri May 2 07:49:36 2008
New Revision: 11177
Modified:
dbd-oracle/branches/no_8/Makefile.PL
dbd-oracle/branches/no_8/Oracle.pm
dbd-oracle/branches/no_8/Oracle.xs
dbd-oracle/branches/no_8/dbdimp.c
dbd-oracle/branches/no_8/oci8.c
dbd-oracle/branches/no_8/ocitrace.h
dbd-oracle/branches/no_8/t/22nchar_al32utf8.t
dbd-oracle/branches/no_8/t/22nchar_utf8.t
dbd-oracle/branches/no_8/t/23wide_db.t
dbd-oracle/branches/no_8/t/23wide_db_8bit.t
dbd-oracle/branches/no_8/t/23wide_db_al32utf8.t
dbd-oracle/branches/no_8/t/24implicit_utf8.t
dbd-oracle/branches/no_8/t/30long.t
Log:
second round of changes
Modified: dbd-oracle/branches/no_8/Makefile.PL
==============================================================================
--- dbd-oracle/branches/no_8/Makefile.PL (original)
+++ dbd-oracle/branches/no_8/Makefile.PL Fri May 2 07:49:36 2008
@@ -159,8 +159,8 @@
# $client_version => Major.Minor, $client_version_full => Major.Minor.X.Y.Z
my ($client_version, $client_version_full) = get_client_version($::opt_V);
-die "DBD::Oracle no longer supports Oracle versions before 8.\n"
- if $client_version < 8;
+die "DBD::Oracle no longer supports Oracle versions before 9.\n"
+ if $client_version < 9;
# Check for symbol table problem in libclntsh.dylib.9.0 on MacOS X
@@ -388,17 +388,11 @@
if !defined $ENV{ORA_CLIENT_LIB}
&& ($opts{LINKTYPE}||'') ne 'static' && @shared && !$::opt_c;
-
my $linkvia = fetch_oci_macros($mkfile) if -f $mkfile;
- my $libhome="$OH/lib";
-
- if ($MK{LIBHOME}){
- my $libhome = expand_mkvars($MK{LIBHOME}, 0, 1) || "$OH/lib";
- }
+ my $libhome = expand_mkvars($MK{LIBHOME}, 0, 1) || "$OH/lib";
$linkwith = expand_mkvars($linkvia, 0, 1);
-
#now use logic based of oracle version
$linkwith =~ s!/lib\b!/$libdir!g;
$libhome =~ s!/lib\b!/$libdir!g;
@@ -445,7 +439,6 @@
next if $line =~ /^\s*\S*echo\s+/;
next if $line =~ /^\s*\S*make\s+/; # remove recursive calls to make
next if $line =~ /^\s*\S*make:/; # remove message from make
- next if $line =~ /^\s*\S*make\[.*\]:/; # remove recursive message
from make
next if $line =~ /^\s*$/; # remove any blank lines
push @filtered_cmds, $line;
}
@@ -674,11 +667,9 @@
# use this if, for some reason the default handling for this function
# doesn't work or you are building a binary release for distribution
# to machines with older client libraries.
-$opts{DEFINE} .= " -DORA_OCI_8" if ($::opt_V && $client_version == 8.0)
- or ($^O eq 'VMS' && $client_version < 9.0); #
OCILobIsTemporary
# OCIStmntFetch2() is a feature of OCI 9.0.0
-$opts{DEFINE} .= " -DUSE_ORA_OCI_STMNT_FETCH " if ( $client_version < 9.0 );
+#$opts{DEFINE} .= " -DUSE_ORA_OCI_STMNT_FETCH " if ( $client_version < 9.0 );
# Set some private WriteMakefile options if this is 'me' :-)
@@ -719,7 +710,7 @@
# --- check for Test::Harness bug
print "\nChecking for functioning wait.ph\n";
-eval { package WAIT; require 'wait.ph' };
+eval { package WAIT; local $^W = 0; require 'wait.ph' };
if (!$@ && !defined(&WAIT::WCOREDUMP)) {
print "You have a wait.ph file generated by perl h2ph utility.\n";
print "(I found it at $INC{'wait.ph'})\n";
@@ -1053,40 +1044,37 @@
sub find_mkfile {
-
- my $mkfile;
- my @mkplaces;
- if ($client_version>=11.1){
-
- my $proc_dir=~ s/lib/share/g;
- $mkfile=$proc_dir."/demo.mk";
- } else {
- my @mk_proc = (
+ my @mk_proc = (
'precomp/demo/proc/proc.mk',
'precomp/demo/proc/demo_proc.mk',
'proc/lib/proc.mk',
'proc16/lib/proc16.mk',
- );
- my @mk_oci = (
+ );
+ my @mk_oci = (
'rdbms/demo/demo_xe.mk',
'rdbms/lib/oracle.mk',
'rdbms/demo/oracle.mk',
'rdbms/demo/demo_rdbms.mk',
- );
- my @mkplaces = ($::opt_p) ? (@mk_proc,@mk_oci) : (@mk_oci,@mk_proc);
- if ($::opt_m) {
- $::opt_m = cwd()."/$::opt_m" unless $::opt_m =~ m:^/:;
- die "-m $::opt_m: not found" unless -f $::opt_m;
- unshift @mkplaces, $::opt_m;
- }
-
- foreach my $place (@mkplaces) {
- $place = "$OH/$place"
- unless $place =~ m:^[/\.]:; # abs or relative path
- next unless -f $place;
- $mkfile ||= $place; # use first one found
- print "Found $place\n";
- }
+ );
+
+ # Add bnild.mk from /usr/share/oracle based on the oracle home
location if oracle home is under
+ # /usr/lib/oracle ( Linux RPM install ). The 11g instant client only
contains
+ # build.mk located in /usr/share/oracle/
+ push @mk_oci, "/usr/share/oracle/$1/demo.mk" if($OH =~
m|^/usr/lib/oracle/(.*)|);
+
+ my @mkplaces = ($::opt_p) ? (@mk_proc,@mk_oci) : (@mk_oci,@mk_proc);
+ if ($::opt_m) {
+ $::opt_m = cwd()."/$::opt_m" unless $::opt_m =~ m:^/:;
+ die "-m $::opt_m: not found" unless -f $::opt_m;
+ unshift @mkplaces, $::opt_m;
+ }
+ my $mkfile;
+ foreach my $place (@mkplaces) {
+ $place = "$OH/$place"
+ unless $place =~ m:^[/\.]:; # abs or relative path
+ next unless -f $place;
+ $mkfile ||= $place; # use first one found
+ print "Found $place\n";
}
die qq{
Unable to locate an oracle.mk, proc.mk or other suitable *.mk
@@ -1102,11 +1090,11 @@
In the unlikely event that a suitable *.mk file is installed
somewhere non-standard you can specify where it is using the -m option:
- Perl Makefile.PL -m /path/to/your.mk
+ perl Makefile.PL -m /path/to/your.mk
See the appropriate README file for your OS for more information and
some alternatives.
- } unless ($os eq 'MSWin32') || ($os eq 'VMS') || ($mkfile && -f $mkfile)
|| $::opt_F || ($client_version>=11.1);
+ } unless ($os eq 'MSWin32') || ($os eq 'VMS') || ($mkfile && -f $mkfile)
|| $::opt_F;
print "Using $mkfile\n";
return $mkfile;
@@ -1356,6 +1344,9 @@
sub expand_mkvars {
my ($string, $strip, $backtick, $level, $maxlevel) = @_;
+
+ return if(!defined $string);
+
$level ||= 1;
local($_) = $string;
print "$level Expanding $_\n" if $::opt_d;
@@ -1439,9 +1430,13 @@
"/usr/include/oracle/$client_version_trim/client", # Instant Client for
RedHat FC4
"/include/oracle/$client_version_full/client", # Instant Client for
RedHat FC3
"/include/oracle/$client_version_trim/client", # Instant Client for
RedHat FC3
- "/usr/include/oracle/11.1.0.1/client/" #Instant Client for RedHat FC3
11.1.0.6 bad hack I know
-
);
+
+ # Add /usr/include/oracle based on the oracle home location if oracle
home is under
+ # /usr/lib/oracle ( Linux RPM install ). The 11g instant client
reports
+ # client_version as 11.1.0.6 from sqlplus, but installs under 11.1.0.1.
+ push @try, "/usr/include/oracle/$1" if($OH =~
m|^/usr/lib/oracle/(.*)|);
+
unshift @try, $::opt_h if $::opt_h;
@try = grep { -d $_ } @try;
@@ -1578,7 +1573,7 @@
}
if (!$client_version_full) {
- $client_version_full = "8.0.0.0";
+ $client_version_full = "9.0.0.0";
print qq{
WARNING: I could not determine Oracle client version so I'll just
default to version $client_version_full. Some features of DBD::Oracle may not
work.
Modified: dbd-oracle/branches/no_8/Oracle.pm
==============================================================================
--- dbd-oracle/branches/no_8/Oracle.pm (original)
+++ dbd-oracle/branches/no_8/Oracle.pm Fri May 2 07:49:36 2008
@@ -1054,7 +1054,7 @@
running on, "SID" is the SID of the database, "DB" is the SQL*Net 2.x
connection descriptor for the database.
-B<Note:> Some of these formats may not work with Oracle 8+.
+B<Note:> Some of these formats may not work with Oracle 9+.
BEGIN {
$ENV{ORACLE_HOME} = '/home/oracle/product/7.x.x';
@@ -1795,12 +1795,6 @@
NLS_NCHAR=UTF8
NLS_NCHAR=AL32UTF8
-Oracle 8 client libraries have a number of bugs related to character
-set handling, especially when connected to an Oracle 9+ server.
-For this reason a number of DBD::Oracle tests are disabled when
-using an Oracle 8 client. If you wish to use Unicode, I recommend
-upgrading client and server to Oracle 9 or later.
-
=head2 Oracle UTF8 is not UTF-8
AL32UTF8 should be used in preference to UTF8 if it works for you,
@@ -3284,9 +3278,7 @@
Here's an alternative form using a function that returns a cursor.
This example uses the pre-defined weak (or generic) REF CURSOR type
-SYS_REFCURSOR. This is an Oracle 9 feature. For Oracle 8, you must
-create your own REF CURSOR type in a package (see the C<curref.pl>
-script mentioned at the end of this section).
+SYS_REFCURSOR. This is an Oracle 9 feature.
# Create the function that returns a cursor
$dbh->do(q{
Modified: dbd-oracle/branches/no_8/Oracle.xs
==============================================================================
--- dbd-oracle/branches/no_8/Oracle.xs (original)
+++ dbd-oracle/branches/no_8/Oracle.xs Fri May 2 07:49:36 2008
@@ -308,7 +308,7 @@
STRLEN data_len; /* bytes not chars */
dvoid *bufp;
sword status;
-#if defined(ORA_OCI_8) || !defined(OCI_HTYPE_DIRPATH_FN_CTX) /* Oracle is <
9.0 */
+#if !defined(OCI_HTYPE_DIRPATH_FN_CTX) /* Oracle is < 9.0 */
ub4 startp;
#endif
ub1 csform;
@@ -339,7 +339,6 @@
#endif /* OCI_ATTR_CHARSET_ID */
/* if data is utf8 but charset isn't then switch to utf8 csid */
csid = (SvUTF8(data) && !CS_IS_UTF8(csid)) ? utf8_csid :
CSFORM_IMPLIED_CSID(csform);
-#if !defined(ORA_OCI_8) && defined(OCI_HTYPE_DIRPATH_FN_CTX) /* Oracle is >=
9.0 */
OCILobWriteAppend_log_stat(imp_dbh->svchp, imp_dbh->errhp, locator,
&amtp, bufp, (ub4)data_len, OCI_ONE_PIECE,
NULL, NULL,
@@ -351,31 +350,6 @@
else {
ST(0) = &sv_yes;
}
-#else
- OCILobGetLength_log_stat(imp_dbh->svchp, imp_dbh->errhp, locator, &startp,
status);
- if (status != OCI_SUCCESS) {
- oci_error(dbh, imp_dbh->errhp, status, "OCILobGetLength");
- ST(0) = &sv_undef;
- } else {
- /* start one after the end -- the first position in the LOB is 1 */
- startp++;
- if (DBIS->debug >= 2 )
- PerlIO_printf(DBILOGFP, " Calling OCILobWrite with csid=%d
csform=%d\n",csid, csform );
- OCILobWrite_log_stat(imp_dbh->svchp, imp_dbh->errhp, locator,
- &amtp, startp,
- bufp, (ub4)data_len, OCI_ONE_PIECE,
- NULL, NULL,
- csid, csform , status);
- if (status != OCI_SUCCESS) {
- oci_error(dbh, imp_dbh->errhp, status, "OCILobWrite");
- ST(0) = &sv_undef;
- }
- else {
- ST(0) = &sv_yes;
- }
- }
-#endif
-
void
ora_lob_read(dbh, locator, offset, length)
Modified: dbd-oracle/branches/no_8/dbdimp.c
==============================================================================
--- dbd-oracle/branches/no_8/dbdimp.c (original)
+++ dbd-oracle/branches/no_8/dbdimp.c Fri May 2 07:49:36 2008
@@ -629,7 +629,6 @@
OCIHandleAlloc_ok(imp_dbh->envhp, &imp_dbh->errhp, OCI_HTYPE_ERROR,
status);
#ifndef NEW_OCI_INIT /* have to get charsetid & ncharsetid the old way */
-#if defined(OCI_ATTR_ENV_CHARSET_ID) && !defined(ORA_OCI_8) /* Oracle 9.0+
*/
OCIAttrGet_log_stat(imp_dbh->envhp, OCI_HTYPE_ENV, &charsetid, (ub4)0 ,
OCI_ATTR_ENV_CHARSET_ID, imp_dbh->errhp, status);
if (status != OCI_SUCCESS) {
@@ -642,21 +641,6 @@
oci_error(dbh, imp_dbh->errhp, status, "OCIAttrGet
OCI_ATTR_ENV_NCHARSET_ID");
return 0;
}
-#else /* Oracle 8.x */
- {
- /* We don't have a way to get the actual charsetid & ncharsetid in use
- * but we only care about UTF8 so we'll just check for that and use the
- * the hardcoded utf8_csid if found
- */
- char buf[81];
- char *nls = ora_env_var("NLS_LANG", buf, sizeof(buf)-1);
- if (nls && strlen(nls) >= 4 && !strcasecmp(nls + strlen(nls) - 4,
"utf8"))
- charsetid = utf8_csid;
- nls = ora_env_var("NLS_NCHAR", buf, sizeof(buf)-1);
- if (nls && strlen(nls) >= 4 && !strcasecmp(nls + strlen(nls) - 4,
"utf8"))
- ncharsetid = utf8_csid;
- }
-#endif
#endif
/* At this point we have charsetid & ncharsetid
Modified: dbd-oracle/branches/no_8/oci8.c
==============================================================================
--- dbd-oracle/branches/no_8/oci8.c (original)
+++ dbd-oracle/branches/no_8/oci8.c Fri May 2 07:49:36 2008
@@ -868,7 +868,6 @@
}
}
-#if !defined(ORA_OCI_8)
/* create temporary LOB for PL/SQL placeholder */
else if (imp_sth->stmt_type == OCI_STMT_BEGIN ||
@@ -924,7 +923,6 @@
}
}
}
-#endif
return 1;
}
Modified: dbd-oracle/branches/no_8/ocitrace.h
==============================================================================
--- dbd-oracle/branches/no_8/ocitrace.h (original)
+++ dbd-oracle/branches/no_8/ocitrace.h Fri May 2 07:49:36 2008
@@ -335,7 +335,6 @@
oci_status_name(stat)),stat : stat
/*Added by JPS for Jeffrey.Klein*/
-#if !defined(ORA_OCI_8)
#define OCILobCreateTemporary_log_stat(sv,eh,lh,csi,csf,lt,ca,dur,stat) \
stat=OCILobCreateTemporary(sv,eh,lh,csi,csf,lt,ca,dur);
\
(DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP,
\
@@ -343,36 +342,22 @@
OciTp, (void*)sv,(void*)eh,(void*)lh, \
ul_t(csi),ul_t(csf),ul_t(lt),ul_t(ca),ul_t(dur), \
oci_status_name(stat)),stat : stat
-#else
-#define OCILobCreateTemporary_log_stat(sv,eh,lh,stat) \
- stat=0 /* Actually, this should be a compile error */
-#endif
-
/*end add*/
-#if !defined(ORA_OCI_8)
#define OCILobFreeTemporary_log_stat(sv,eh,lh,stat) \
stat=OCILobFreeTemporary(sv,eh,lh);
\
(DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP,
\
"%sLobFreeTemporary(%p,%p,%p)=%s\n", \
OciTp, (void*)sv,(void*)eh,(void*)lh, \
oci_status_name(stat)),stat : stat
-#else
-#define OCILobFreeTemporary_log_stat(sv,eh,lh,stat) \
- stat=0
-#endif
-#if !defined(ORA_OCI_8)
#define OCILobIsTemporary_log_stat(ev,eh,lh,istemp,stat)
\
stat=OCILobIsTemporary(ev,eh,lh,istemp);
\
(DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP,
\
"%sLobIsTemporary(%p,%p,%p,%p)=%s\n", \
OciTp, (void*)ev,(void*)eh,(void*)lh,(void*)istemp, \
oci_status_name(stat)),stat : stat
-#else
-#define OCILobIsTemporary_log_stat(ev,eh,lh,istemp,stat) \
- stat=0
-#endif
+
/*Added by JPS for Jeffrey.Klein */
#define OCILobLocatorAssign_log_stat(sv,eh,src,dest,stat) \
@@ -439,21 +424,12 @@
OciTp, (void*)sv,(void*)st,(void*)eh,ul_t((i)), \
ul_t((ro)),(void*)(si),(void*)(so),ul_t((md)), \
oci_status_name(stat)),stat : stat
-#if !defined(USE_ORA_OCI_STMNT_FETCH)
#define OCIStmtFetch_log_stat(sh,eh,nr,or,os,stat) \
stat=OCIStmtFetch2(sh,eh,nr,or,os,OCI_DEFAULT);
\
(DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP,
\
"%sStmtFetch(%p,%p,%lu,%u,%lu)=%s\n",
\
OciTp, (void*)sh,(void*)eh,ul_t(nr),(ub2)or,(ub2)os,
\
oci_status_name(stat)),stat : stat
-#else
-#define OCIStmtFetch_log_stat(sh,eh,nr,or,os,stat) \
- stat=OCIStmtFetch(sh,eh,nr,or,OCI_DEFAULT);
\
- (DBD_OCI_TRACEON) ? PerlIO_printf(DBD_OCI_TRACEFP,
\
- "%sStmtFetch(%p,%p,%lu,%lu)=%s\n", \
- OciTp, (void*)sh,(void*)eh,ul_t(nr),(ub2)or, \
- oci_status_name(stat)),stat : stat
-#endif
#define OCIStmtPrepare_log_stat(sh,eh,s1,sl,l,m,stat) \
stat=OCIStmtPrepare(sh,eh,s1,sl,l,m); \
Modified: dbd-oracle/branches/no_8/t/22nchar_al32utf8.t
==============================================================================
--- dbd-oracle/branches/no_8/t/22nchar_al32utf8.t (original)
+++ dbd-oracle/branches/no_8/t/22nchar_al32utf8.t Fri May 2 07:49:36 2008
@@ -16,8 +16,6 @@
SKIP: {
plan skip_all => "Unable to run unicode test, perl version is less than
5.6" unless ( $] >= 5.006 );
- plan skip_all => "Oracle charset tests unreliable for Oracle 8 client"
- if ORA_OCI() < 9.0 and !$ENV{DBD_ALL_TESTS};
set_nls_nchar( (ORA_OCI >= 9.2) ? 'AL32UTF8' : 'UTF8', 1 );
$dbh = db_handle();
Modified: dbd-oracle/branches/no_8/t/22nchar_utf8.t
==============================================================================
--- dbd-oracle/branches/no_8/t/22nchar_utf8.t (original)
+++ dbd-oracle/branches/no_8/t/22nchar_utf8.t Fri May 2 07:49:36 2008
@@ -16,9 +16,7 @@
SKIP: {
plan skip_all => "Unable to run unicode test, perl version is less than
5.6" unless ( $] >= 5.006 );
- plan skip_all => "Oracle charset tests unreliable for Oracle 8 client"
- if ORA_OCI() < 9.0 and !$ENV{DBD_ALL_TESTS};
-
+
set_nls_nchar( (ORA_OCI >= 9.2) ? 'AL32UTF8' : 'UTF8' ,1 );
$dbh = db_handle();
Modified: dbd-oracle/branches/no_8/t/23wide_db.t
==============================================================================
--- dbd-oracle/branches/no_8/t/23wide_db.t (original)
+++ dbd-oracle/branches/no_8/t/23wide_db.t Fri May 2 07:49:36 2008
@@ -16,8 +16,6 @@
SKIP: {
plan skip_all => "Unable to run unicode test, perl version is less than
5.6" unless ( $] >= 5.006 );
- plan skip_all => "Oracle charset tests unreliable for Oracle 8 client"
- if ORA_OCI() < 9.0 and !$ENV{DBD_ALL_TESTS};
#! #force Ncharset to NON UTF8! we are testing a wide database where someone
#! #perversely sets nchar to non utf8, and nls_lang to utf8....
Modified: dbd-oracle/branches/no_8/t/23wide_db_8bit.t
==============================================================================
--- dbd-oracle/branches/no_8/t/23wide_db_8bit.t (original)
+++ dbd-oracle/branches/no_8/t/23wide_db_8bit.t Fri May 2 07:49:36 2008
@@ -16,9 +16,7 @@
SKIP: {
plan skip_all => "Unable to run unicode test, perl version is less than
5.6" unless ( $] >= 5.006 );
- plan skip_all => "Oracle charset tests unreliable for Oracle 8 client"
- if ORA_OCI() < 9.0 and !$ENV{DBD_ALL_TESTS};
-
+
set_nls_lang_charset( 'WE8MSWIN1252' ,1 );
$dbh = db_handle();
Modified: dbd-oracle/branches/no_8/t/23wide_db_al32utf8.t
==============================================================================
--- dbd-oracle/branches/no_8/t/23wide_db_al32utf8.t (original)
+++ dbd-oracle/branches/no_8/t/23wide_db_al32utf8.t Fri May 2 07:49:36 2008
@@ -17,8 +17,6 @@
plan skip_all => "Unable to run unicode test, perl version is less than
5.6"
unless ( $] >= 5.006 );
- plan skip_all => "Oracle charset tests unreliable for Oracle 8 client"
- if ORA_OCI() < 9.0 and !$ENV{DBD_ALL_TESTS};
set_nls_lang_charset( (ORA_OCI >= 9.2) ? 'AL32UTF8' : 'UTF8', 1 );
$dbh = db_handle();
Modified: dbd-oracle/branches/no_8/t/24implicit_utf8.t
==============================================================================
--- dbd-oracle/branches/no_8/t/24implicit_utf8.t (original)
+++ dbd-oracle/branches/no_8/t/24implicit_utf8.t Fri May 2 07:49:36 2008
@@ -15,9 +15,7 @@
$| = 1;
SKIP: {
plan skip_all => "Unable to run 8bit char test, perl version is less than
5.6" unless ( $] >= 5.006 );
- plan skip_all => "Oracle charset tests unreliable for Oracle 8 client"
- if ORA_OCI() < 9.0 and !$ENV{DBD_ALL_TESTS};
-
+
$dbh = db_handle(); # just to check connection and db NCHAR
character set
plan skip_all => "Not connected to oracle" if not $dbh;
plan skip_all => "Database NCHAR character set is not Unicode" if not
db_nchar_is_utf($dbh) ;
Modified: dbd-oracle/branches/no_8/t/30long.t
==============================================================================
--- dbd-oracle/branches/no_8/t/30long.t (original)
+++ dbd-oracle/branches/no_8/t/30long.t Fri May 2 07:49:36 2008
@@ -341,9 +341,6 @@
# and append some text
SKIP: {
$append_len = 0;
- skip( "ora_lob_append() not reliable in Oracle 8 (Oracle
bug #886191)", 1 )
- if ORA_OCI() < 9 or $ora_server_version->[0] < 9;
-
my $append_data = "12345";
$append_len = length($append_data);
$dbh->func($lob_locator, $append_data, 'ora_lob_append');