On Tue, Mar 25, 2003 at 03:58:18PM +0100, H.Merijn Brand wrote:
> On Tue 25 Mar 2003 15:09, Tim Bunce <[EMAIL PROTECTED]> wrote:
> > Here's a Release Candidate of DBD::Oracle 1.14:
> >
> > http://homepage.eircom.net/~timbunce/DBD-Oracle-1.14-20020325gamma.tar.gz
> >
> > I'd appreciate it if people could give it a whirl ASAP...
>
>
> Hmm, allow even better fallback mechanism for version detection from $OH?
>
> --8<---
> Using Oracle in /pro/oracle/v817
>
> WARNING: could not decode oracle version from
> /pro/oracle/v817/orainst/inspdver
> or from Oracle Home:
> /pro/oracle/v817
> Oracle version based logic may produce erroneous results
> -->8---
How about this (untested, but ready for Oracle 10 :-) ...
--- Makefile.PL 2003/03/25 13:53:55 1.103
+++ Makefile.PL 2003/03/25 15:26:43
@@ -143,13 +143,16 @@
elsif ( $OH =~ m!.*(\d+\.\d+\.\d+)! ) { #decode it from $OH if possible
$inspdver{RDBMS} = $1;
}
+ elsif ( "$OH/" =~ m!\D(1?\d)(\d)(\d)\D!) { # scary but handy
+ $inspdver{RDBMS} = join ".", $1, $2, $3;
+ }
else {
print qq{
WARNING: could not decode oracle version from
$OH/orainst/inspdver
or from Oracle Home:
$OH
-Oracle version based logic may produce erroneous results
+Oracle version based logic in Makefile.PL may produce erroneous results.
};
}
And isn't there a more reliable way if orainst/inspdver doesn't exist?
There ought to be something somewhere that gives the version number!
> Maybe you can guard the tests against `closed' databases:
>
> t/cursor.....Unable to connect to Oracle as foo/bar (ORA-01034: ORACLE not
> available
> ORA-27101: shared memory realm does not exist
> HP-UX Error: 2: No such file or directory (DBD ERROR: OCISessionBegin))
> Tests skipped.
I'm not sure what you mean by "guard". At least it skipped the test cleanly :)
> DBI connect('','foo/bar',...) failed: ORA-01034: ORACLE not available
> ORA-27101: shared memory realm does not exist
> HP-UX Error: 2: No such file or directory (DBD ERROR: OCISessionBegin) at /pro/3
> gl/CPAN/DBD-Oracle-1.14/blib/lib/Oraperl.pm line 97
> Use of uninitialized value in concatenation (.) or string at test.pl line 69.
> Use of uninitialized value in concatenation (.) or string at test.pl line 69.
> ora_login: :
Ah, interestingly this highlights a change that's broken the old
Oraperl global $ora_errno and $ora_errstr variables. Umm, question is,
can I summon the will to fix it...
> After starting the DB, I get
>
> t/meta.......Use of uninitialized value in sprintf at
> /pro/3gl/CPAN/DBD-Oracle-1.14/blib/lib/DBD/Oracle/GetInfo.pm line 7.
> Use of uninitialized value in sprintf at
> /pro/3gl/CPAN/DBD-Oracle-1.14/blib/lib/DBD/Oracle/GetInfo.pm line 7.
> Use of uninitialized value in sprintf at
> /pro/3gl/CPAN/DBD-Oracle-1.14/blib/lib/DBD/Oracle/GetInfo.pm line 7.
> Use of uninitialized value in sprintf at
> /pro/3gl/CPAN/DBD-Oracle-1.14/blib/lib/DBD/Oracle/GetInfo.pm line 7.
> --8<--- GetInfo.pm
> my $fmt = '%02d.%02d.%1d%1d%1d%1d'; # ODBC version string: ##.##.#####
> my $sql_driver_ver = sprintf $fmt, split (/\./, $DBD::Oracle::VERSION);
> -->8---
>
> $DBD::Oracle::VERSION = 1.14
> maybe you want
> my $sql_driver_ver = sprintf $fmt, split (/\./, "$DBD::Oracle::VERSION.0.0.0.0.0.0");
Done. Thanks.
Tim.