[svn:dbd-oracle] r14656 - in dbd-oracle/trunk: . t
[email protected] Thu, 27 Jan 2011 07:44:40 -0800 (PST)
| Newsgroups | perl.dbd.oracle.changes |
|---|---|
| Message-ID | <[email protected]> |
Author: byterock
Date: Thu Jan 27 07:44:38 2011
New Revision: 14656
Modified:
dbd-oracle/trunk/Changes
dbd-oracle/trunk/t/10general.t
dbd-oracle/trunk/t/12impdata.t
dbd-oracle/trunk/t/14threads.t
dbd-oracle/trunk/t/15nls.t
dbd-oracle/trunk/t/20select.t
dbd-oracle/trunk/t/21nchar.t
dbd-oracle/trunk/t/22nchar_al32utf8.t
dbd-oracle/trunk/t/22nchar_utf8.t
dbd-oracle/trunk/t/23wide_db.t
dbd-oracle/trunk/t/23wide_db_8bit.t
dbd-oracle/trunk/t/23wide_db_al32utf8.t
dbd-oracle/trunk/t/24implicit_utf8.t
dbd-oracle/trunk/t/25plsql.t
dbd-oracle/trunk/t/26exe_array.t
dbd-oracle/trunk/t/28array_bind.t
dbd-oracle/trunk/t/30long.t
dbd-oracle/trunk/t/31lob.t
dbd-oracle/trunk/t/31lob_extended.t
dbd-oracle/trunk/t/32xmltype.t
dbd-oracle/trunk/t/34pres_lobs.t
dbd-oracle/trunk/t/36lob_leak.t
dbd-oracle/trunk/t/40ph_type.t
dbd-oracle/trunk/t/50cursor.t
dbd-oracle/trunk/t/51scroll.t
dbd-oracle/trunk/t/55nested.t
dbd-oracle/trunk/t/56embbeded.t
dbd-oracle/trunk/t/58object.t
dbd-oracle/trunk/t/60reauth.t
dbd-oracle/trunk/t/70meta.t
dbd-oracle/trunk/t/80ora_charset.t
dbd-oracle/trunk/t/nchar_test_lib.pl
dbd-oracle/trunk/test.pl
Log:
Fix for rt 64244 - don't fail but skip tests if can not connect by Martin J. Evans and John Scoles
Modified: dbd-oracle/trunk/Changes
==============================================================================
--- dbd-oracle/trunk/Changes (original)
+++ dbd-oracle/trunk/Changes Thu Jan 27 07:44:38 2011
@@ -1,5 +1,6 @@
=head1 Changes in DBD-Oracle 1.28 (svn rev 14583)
+ Fix for rt 64244 - don't bail out, skip tests we cannot connect by Martin J. Evans and John Scoles
Added DBI to PREREQ_PM in Makefile.PL by Martin J. Evans
Added build_requires in Makefile.PL by Martin J. Evans
Added workaround for ExtUtils::MakeMaker problems by Martin J. Evans
Modified: dbd-oracle/trunk/t/10general.t
==============================================================================
--- dbd-oracle/trunk/t/10general.t (original)
+++ dbd-oracle/trunk/t/10general.t Thu Jan 27 07:44:38 2011
@@ -13,17 +13,20 @@
$| = 1;
-plan tests => 30;
-
diag('Test preparsing, Active, NLS_NUMERIC_CHARACTERS, err, ping and OCI version');
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '');
-unless($dbh) {
- BAIL_OUT("Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n");
- exit 0;
+my $dbh = DBI->connect($dsn, $dbuser, '',
+ {
+ PrintError => 0,
+ });
+
+if ($dbh) {
+ plan tests => 30;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
}
my($sth, $p1, $p2, $tmp);
@@ -83,6 +86,7 @@
eval {
local $SIG{__WARN__} = sub { $warn = $_[0] };
$dbh->{RaiseError} = 1;
+ $dbh->{PrintError} = 1;
$dbh->do("some invalid sql statement");
};
ok($@ =~ /DBD::Oracle::db do failed:/, "eval error: ``$@'' expected 'do failed:'");
@@ -92,7 +96,7 @@
ok($ora_errno, 'ora_errno defined');
is($ora_errno, $DBI::err, 'ora_errno and err equal');
$dbh->{RaiseError} = 0;
-
+$dbh->{PrintError} = 0;
# ---
ok( $dbh->ping, 'ping - connected');
Modified: dbd-oracle/trunk/t/12impdata.t
==============================================================================
--- dbd-oracle/trunk/t/12impdata.t (original)
+++ dbd-oracle/trunk/t/12impdata.t Thu Jan 27 07:44:38 2011
@@ -21,15 +21,20 @@
die $use_threads_err if $use_threads_err; # need threads
}
-use Test::More tests => 7;
-
unshift @INC, 't';
require 'nchar_test_lib.pl';
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect( $dsn, $dbuser, '', );
-
+my $dbh = DBI->connect( $dsn, $dbuser, '', {
+ PrintError => 0,
+ });
+
+if ($dbh) {
+ plan tests => 7;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
my $drh = $dbh->{Driver};
my ($sess_1) = $dbh->selectrow_array("select userenv('sessionid') from dual");
Modified: dbd-oracle/trunk/t/14threads.t
==============================================================================
--- dbd-oracle/trunk/t/14threads.t (original)
+++ dbd-oracle/trunk/t/14threads.t Thu Jan 27 07:44:38 2011
@@ -24,11 +24,23 @@
use strict;
use DBI;
-use Test::More tests => 19;
+use Test::More;
unshift @INC, 't';
require 'nchar_test_lib.pl';
+my $dsn = oracle_test_dsn();
+my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
+my $dbh = DBI->connect($dsn, $dbuser, '',{
+ PrintError => 0,
+ });
+
+if ($dbh) {
+ plan tests => 19;
+ $dbh->disconnect;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
my $last_session : shared;
our @pool : shared;
Modified: dbd-oracle/trunk/t/15nls.t
==============================================================================
--- dbd-oracle/trunk/t/15nls.t (original)
+++ dbd-oracle/trunk/t/15nls.t Thu Jan 27 07:44:38 2011
@@ -9,7 +9,6 @@
require 'nchar_test_lib.pl';
my $testcount = 9;
-plan tests => $testcount;
$| = 1;
@@ -17,37 +16,34 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-SKIP :
-{
- my $dbh = DBI->connect($dsn, $dbuser, '',
- {
- AutoCommit => 1,
- PrintError => 1,
- });
-
- skip "Unable to connect to Oracle ($DBI::errstr)", $testcount
- unless ($dbh);
+my $dbh = DBI->connect($dsn, $dbuser, '',{
+ PrintError => 0,
+ });
+if ($dbh) {
+ plan tests => $testcount;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
- my ($nls_parameters_before, $nls_parameters_after);
- my $old_date_format = 'HH24:MI:SS DD/MM/YYYY';
- my $new_date_format = 'YYYYMMDDHH24MISS';
+my ($nls_parameters_before, $nls_parameters_after);
+my $old_date_format = 'HH24:MI:SS DD/MM/YYYY';
+my $new_date_format = 'YYYYMMDDHH24MISS';
- ok($dbh->do("alter session set nls_date_format='$old_date_format'"), 'set date format');
+ok($dbh->do("alter session set nls_date_format='$old_date_format'"), 'set date format');
- like($dbh->ora_can_unicode, qr/^[0123]/, 'ora_can_unicode');
+like($dbh->ora_can_unicode, qr/^[0123]/, 'ora_can_unicode');
- ok($nls_parameters_before = $dbh->ora_nls_parameters, 'fetch ora_nls_parameters');
- is(ref($nls_parameters_before), 'HASH', 'check ora_nls_parameters returned hashref');
- is($nls_parameters_before->{'NLS_DATE_FORMAT'}, $old_date_format, 'check returned nls_date_format');
+ok($nls_parameters_before = $dbh->ora_nls_parameters, 'fetch ora_nls_parameters');
+is(ref($nls_parameters_before), 'HASH', 'check ora_nls_parameters returned hashref');
+is($nls_parameters_before->{'NLS_DATE_FORMAT'}, $old_date_format, 'check returned nls_date_format');
- ok($dbh->do("alter session set nls_date_format='$new_date_format'"), 'alter date format');
- ok(eq_hash($nls_parameters_before, $dbh->ora_nls_parameters), 'check ora_nls_parameters caches old values');
+ok($dbh->do("alter session set nls_date_format='$new_date_format'"), 'alter date format');
+ok(eq_hash($nls_parameters_before, $dbh->ora_nls_parameters), 'check ora_nls_parameters caches old values');
- $nls_parameters_before->{NLS_DATE_FORMAT} = 'foo';
- isnt($nls_parameters_before->{NLS_DATE_FORMAT},
- $dbh->ora_nls_parameters->{NLS_DATE_FORMAT}, 'check ora_nls_parameters returns a copy');
+$nls_parameters_before->{NLS_DATE_FORMAT} = 'foo';
+isnt($nls_parameters_before->{NLS_DATE_FORMAT},
+ $dbh->ora_nls_parameters->{NLS_DATE_FORMAT}, 'check ora_nls_parameters returns a copy');
- is($dbh->ora_nls_parameters(1)->{'NLS_DATE_FORMAT'}, $new_date_format, 'refetch and check new nls_date_format value');
-}
+is($dbh->ora_nls_parameters(1)->{'NLS_DATE_FORMAT'}, $new_date_format, 'refetch and check new nls_date_format value');
__END__
Modified: dbd-oracle/trunk/t/20select.t
==============================================================================
--- dbd-oracle/trunk/t/20select.t (original)
+++ dbd-oracle/trunk/t/20select.t Thu Jan 27 07:44:38 2011
@@ -35,14 +35,13 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
my $dbh = DBI->connect($dsn, $dbuser, '', {
- AutoCommit => 1,
- PrintError => 0,
-});
+ PrintError => 0,
+ });
if ($dbh) {
plan tests=>$tests;
} else {
- plan skip_all => "Unable to connect to oracle ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to oracle\n";
}
diag('test simple select statements with [utf8]');
Modified: dbd-oracle/trunk/t/21nchar.t
==============================================================================
--- dbd-oracle/trunk/t/21nchar.t (original)
+++ dbd-oracle/trunk/t/21nchar.t Thu Jan 27 07:44:38 2011
@@ -17,7 +17,8 @@
plan skip_all => "Unable to run 8bit char test, perl version is less than 5.6" unless ( $] >= 5.006 );
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ # $dbh->{PrintError} = 1;
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
diag("testing control and 8 bit chars:\n") ;
diag(" Database and client versions and character sets:\n");
Modified: dbd-oracle/trunk/t/22nchar_al32utf8.t
==============================================================================
--- dbd-oracle/trunk/t/22nchar_al32utf8.t (original)
+++ dbd-oracle/trunk/t/22nchar_al32utf8.t Thu Jan 27 07:44:38 2011
@@ -22,7 +22,7 @@
set_nls_nchar( (ORA_OCI >= 9.2) ? 'AL32UTF8' : 'UTF8', 1 );
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
plan skip_all => "Database NCHAR character set is not Unicode" if not db_nchar_is_utf($dbh) ;
print "testing utf8 with nchar columns\n" ;
Modified: dbd-oracle/trunk/t/22nchar_utf8.t
==============================================================================
--- dbd-oracle/trunk/t/22nchar_utf8.t (original)
+++ dbd-oracle/trunk/t/22nchar_utf8.t Thu Jan 27 07:44:38 2011
@@ -22,7 +22,7 @@
set_nls_nchar( (ORA_OCI >= 9.2) ? 'AL32UTF8' : 'UTF8' ,1 );
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
plan skip_all => "Database NCHAR character set is not Unicode" if not db_nchar_is_utf($dbh) ;
diag("testing utf8 with nchar columns\n");
Modified: dbd-oracle/trunk/t/23wide_db.t
==============================================================================
--- dbd-oracle/trunk/t/23wide_db.t (original)
+++ dbd-oracle/trunk/t/23wide_db.t Thu Jan 27 07:44:38 2011
@@ -25,7 +25,7 @@
#! #set_nls_nchar( 'WE8ISO8859P1' ,1 ); #it breaks and it is stupid to do this... doc it XXX
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
plan skip_all => "Database character set is not Unicode" if not db_ochar_is_utf($dbh) ;
print "testing utf8 with char columns (wide mode database)\n" ;
Modified: dbd-oracle/trunk/t/23wide_db_8bit.t
==============================================================================
--- dbd-oracle/trunk/t/23wide_db_8bit.t (original)
+++ dbd-oracle/trunk/t/23wide_db_8bit.t Thu Jan 27 07:44:38 2011
@@ -22,7 +22,7 @@
set_nls_lang_charset( 'WE8MSWIN1252' ,1 );
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
plan skip_all => "Database character set is not Unicode" if not db_ochar_is_utf($dbh) ;
print "testing utf8 with char columns (wide mode database)\n" ;
Modified: dbd-oracle/trunk/t/23wide_db_al32utf8.t
==============================================================================
--- dbd-oracle/trunk/t/23wide_db_al32utf8.t (original)
+++ dbd-oracle/trunk/t/23wide_db_al32utf8.t Thu Jan 27 07:44:38 2011
@@ -23,7 +23,7 @@
set_nls_lang_charset( (ORA_OCI >= 9.2) ? 'AL32UTF8' : 'UTF8', 1 );
$dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
plan skip_all => "Database character set is not Unicode" if not db_ochar_is_utf($dbh) ;
diag("testing utf8 with char columns (wide mode database)\n") ;
Modified: dbd-oracle/trunk/t/24implicit_utf8.t
==============================================================================
--- dbd-oracle/trunk/t/24implicit_utf8.t (original)
+++ dbd-oracle/trunk/t/24implicit_utf8.t Thu Jan 27 07:44:38 2011
@@ -19,7 +19,9 @@
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 => "Unable to connect to Oracle" if not $dbh;
plan skip_all => "Database NCHAR character set is not Unicode" if not db_nchar_is_utf($dbh) ;
$dbh->disconnect();
Modified: dbd-oracle/trunk/t/25plsql.t
==============================================================================
--- dbd-oracle/trunk/t/25plsql.t (original)
+++ dbd-oracle/trunk/t/25plsql.t Thu Jan 27 07:44:38 2011
@@ -26,7 +26,7 @@
}
plan tests=>82;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle \n";
}
Modified: dbd-oracle/trunk/t/26exe_array.t
==============================================================================
--- dbd-oracle/trunk/t/26exe_array.t (original)
+++ dbd-oracle/trunk/t/26exe_array.t Thu Jan 27 07:44:38 2011
@@ -19,27 +19,25 @@
## an ASCII only DB
## ----------------------------------------------------------------------------
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
$ENV{NLS_NCHAR} = "US7ASCII";
$ENV{NLS_LANG} = "AMERICAN";
-my $dbh = DBI->connect($dsn, $dbuser, '', {
- AutoCommit=>1,
- PrintError => 0,
- ora_envhp => 0,
- });
+my $dbh;
-if ($dbh){
- plan tests => 16;
+eval {
+ $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0,
+ ora_envhp => 0,
+ })
+};
+if ($dbh) {
+ plan tests => 16;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
}
-else {
-
- plan skip_all => "Not connected to oracle" if not $dbh;
-}
-
-
# check that our db handle is good
isa_ok($dbh, "DBI::db");
Modified: dbd-oracle/trunk/t/28array_bind.t
==============================================================================
--- dbd-oracle/trunk/t/28array_bind.t (original)
+++ dbd-oracle/trunk/t/28array_bind.t Thu Jan 27 07:44:38 2011
@@ -58,7 +58,7 @@
my $p = {
AutoCommit => 1,
- PrintError => 1,
+ PrintError => 0,
FetchHashKeyName => 'NAME_lc',
ora_envhp => 0, # force fresh environment (with current NLS env vars)
};
@@ -278,13 +278,15 @@
SKIP: {
$dbh = db_connect(0);
- plan skip_all => "Not connected to oracle" if not $dbh;
- plan tests => 19;
+ if ($dbh) {
+ plan tests => 15;
+ } else {
+ plan skip_all => "Unable to connect to Oracle" if not $dbh;
+ }
test_varchar2_table_3_tests($dbh);
test_number_table_3_tests($dbh);
test_inout_array_tests($dbh);
- test_number_SP($dbh);
};
Modified: dbd-oracle/trunk/t/30long.t
==============================================================================
--- dbd-oracle/trunk/t/30long.t (original)
+++ dbd-oracle/trunk/t/30long.t Thu Jan 27 07:44:38 2011
@@ -23,8 +23,6 @@
#very odd little thing that took a while to figure out.
#Seems I now have 479 tests which is 9 more so 96 test then -1 to round it off
-plan tests => $tests;
-
$| = 1;
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
my $table = table();
@@ -42,7 +40,21 @@
my($p1, $p2, $tmp, @tmp);
-my $dbh = db_handle() or BAILOUT("Can't connect to database: $DBI::errstr");
+#my $dbh = db_handle();
+
+
+ $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
+ my $dsn = oracle_test_dsn();
+ my $dbh = DBI->connect($dsn, $dbuser, '',{
+ PrintError => 0,
+ });
+
+if ($dbh) {
+ plan tests => $tests;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
+
my $ora_server_version = $dbh->func("ora_server_version");
diag("ora_server_version: @$ora_server_version\n");
show_db_charsets($dbh) if $dbh;
Modified: dbd-oracle/trunk/t/31lob.t
==============================================================================
--- dbd-oracle/trunk/t/31lob.t (original)
+++ dbd-oracle/trunk/t/31lob.t Thu Jan 27 07:44:38 2011
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More ;
+use Test::More;
use DBD::Oracle qw(:ora_types);
use DBI;
@@ -12,8 +12,17 @@
$| = 1;
SKIP: {
- $dbh = db_handle();
- plan skip_all => "Not connected to oracle" if not $dbh;
+ my $dsn = oracle_test_dsn();
+ my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
+
+ $dbh = DBI->connect($dsn, $dbuser, '',{
+ PrintError => 0,
+ });
+ if ($dbh) {
+ plan tests => 12;
+ } else {
+ plan skip_all => "Unable to connect to Oracle";
+ }
my $table = table();
drop_table($dbh);
@@ -24,7 +33,7 @@
data BLOB
)
});
-plan tests => 12;
+
my ($stmt, $sth, $id, $loc);
## test with insert empty blob and select locator.
$stmt = "INSERT INTO $table (id,data) VALUES (1, EMPTY_BLOB())";
Modified: dbd-oracle/trunk/t/31lob_extended.t
==============================================================================
--- dbd-oracle/trunk/t/31lob_extended.t (original)
+++ dbd-oracle/trunk/t/31lob_extended.t Thu Jan 27 07:44:38 2011
@@ -25,13 +25,15 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '');
+my $dbh = DBI->connect($dsn, $dbuser, '',{
+ PrintError => 0,
+ });
if ($dbh) {
plan tests => 31;
$dbh->{LongReadLen} = 7000;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
+ plan skip_all => "Unable to connect to Oracle";
diag('Test reported bugs');
}
Modified: dbd-oracle/trunk/t/32xmltype.t
==============================================================================
--- dbd-oracle/trunk/t/32xmltype.t (original)
+++ dbd-oracle/trunk/t/32xmltype.t Thu Jan 27 07:44:38 2011
@@ -1,7 +1,7 @@
#!/usr/bin/perl
use strict;
-use Test::More tests => 4;
+use Test::More;
use DBD::Oracle qw(:ora_types);
use DBI;
@@ -16,18 +16,20 @@
## Nothing fancy.
## ----------------------------------------------------------------------------
-BEGIN {
- use_ok('DBI');
-}
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 });
-
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 })};
+
+if ($dbh) {
+ plan tests => 3;
+} else {
+ plan skip_all => "Unable to connect to Oracle"
+}
# check that our db handle is good
isa_ok($dbh, "DBI::db");
Modified: dbd-oracle/trunk/t/34pres_lobs.t
==============================================================================
--- dbd-oracle/trunk/t/34pres_lobs.t (original)
+++ dbd-oracle/trunk/t/34pres_lobs.t Thu Jan 27 07:44:38 2011
@@ -23,14 +23,19 @@
$| = 1;
-plan tests => 29;
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 ,LongReadLen=>10000000});
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '',
+ { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 ,LongReadLen=>10000000})};
+if ($dbh) {
+ plan tests => 29;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
# check that our db handle is good
my $ora_oci = DBD::Oracle::ORA_OCI(); # dualvar
Modified: dbd-oracle/trunk/t/36lob_leak.t
==============================================================================
--- dbd-oracle/trunk/t/36lob_leak.t (original)
+++ dbd-oracle/trunk/t/36lob_leak.t Thu Jan 27 07:44:38 2011
@@ -23,13 +23,15 @@
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '');
+my $dbh = DBI->connect($dsn, $dbuser, '',,{
+ PrintError => 0,
+ });
if ($dbh) {
plan tests => 7;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\nTests
-skipped.\n";
+ $dbh->{PrintError}=1;
+ plan skip_all => "Unable to connect to Oracle";
}
# get SID and cached lobs
@@ -152,12 +154,14 @@
if ($dbh) {
local $dbh->{PrintError} = 0;
local $dbh->{RaiseError} = 1;
- eval {$dbh->do(qq/drop function $function/);};
- if ($@) {
- warn("function p_DBD_Oracle_drop_me possibly not dropped" .
+ if ($function){
+ eval {$dbh->do(qq/drop function $function/);};
+ if ($@) {
+ warn("function p_DBD_Oracle_drop_me possibly not dropped" .
"- check - $@\n") if $dbh->err ne '4043';
- } else {
- diag("function p_DBD_Oracle_drop_me dropped");
+ } else {
+ diag("function p_DBD_Oracle_drop_me dropped");
+ }
}
}
-}
\ No newline at end of file
+}
Modified: dbd-oracle/trunk/t/40ph_type.t
==============================================================================
--- dbd-oracle/trunk/t/40ph_type.t (original)
+++ dbd-oracle/trunk/t/40ph_type.t Thu Jan 27 07:44:38 2011
@@ -32,7 +32,7 @@
my $dsn = oracle_test_dsn();
my $dbh = DBI->connect($dsn, $dbuser, '', {
AutoCommit => 0,
- PrintError => 1,
+ PrintError => 0,
FetchHashKeyName => 'NAME_lc',
});
@@ -40,7 +40,7 @@
plan tests => $tests;
} else {
plan skip_all =>
- "Unable to connect to Oracle ($DBI::errstr)\nTests skipped.\n";
+ "Unable to connect to Oracle";
}
eval {
Modified: dbd-oracle/trunk/t/50cursor.t
==============================================================================
--- dbd-oracle/trunk/t/50cursor.t (original)
+++ dbd-oracle/trunk/t/50cursor.t Thu Jan 27 07:44:38 2011
@@ -43,7 +43,7 @@
diag("Max cursors: $limit\n");
} else {
- plan skip_all => "Unable to connect to Oracle as $dbuser ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle";
}
my @cursors;
Modified: dbd-oracle/trunk/t/51scroll.t
==============================================================================
--- dbd-oracle/trunk/t/51scroll.t (original)
+++ dbd-oracle/trunk/t/51scroll.t Thu Jan 27 07:44:38 2011
@@ -16,22 +16,18 @@
## Nothing fancy.
## ----------------------------------------------------------------------------
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { AutoCommit=>1,
- PrintError => 0 });
-
-
-if ($dbh){
- plan tests => 32;
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 })};
+if ($dbh) {
+ plan tests => 32;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
}
-else {
-
- plan skip_all => "Not connected to oracle" if not $dbh;
-}
-
ok ($dbh->{RowCacheSize} = 10);
# check that our db handle is good
Modified: dbd-oracle/trunk/t/55nested.t
==============================================================================
--- dbd-oracle/trunk/t/55nested.t (original)
+++ dbd-oracle/trunk/t/55nested.t Thu Jan 27 07:44:38 2011
@@ -17,7 +17,7 @@
if ($dbh) {
plan tests=> 29;
} else {
- plan skip_all =>"Unable to connect to Oracle as $dbuser ($DBI::errstr)\n";
+ plan skip_all =>"Unable to connect to Oracle";
}
# ref cursors may be slow due to oracle bug 3735785
Modified: dbd-oracle/trunk/t/56embbeded.t
==============================================================================
--- dbd-oracle/trunk/t/56embbeded.t (original)
+++ dbd-oracle/trunk/t/56embbeded.t Thu Jan 27 07:44:38 2011
@@ -4,7 +4,7 @@
use DBD::Oracle qw(ORA_RSET SQLCS_NCHAR);
use strict;
-use Test::More tests =>5;
+use Test::More;
unshift @INC ,'t';
require 'nchar_test_lib.pl';
@@ -18,16 +18,18 @@
## Nothing fancy.
## ----------------------------------------------------------------------------
-BEGIN {
- use_ok('DBI');
-}
-
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
- AutoCommit=>1,
- PrintError => 0 });
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '', { RaiseError=>1,
+ AutoCommit=>1,
+ PrintError => 0 })};
+if ($dbh) {
+ plan tests => 4;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
# check that our db handle is good
Modified: dbd-oracle/trunk/t/58object.t
==============================================================================
--- dbd-oracle/trunk/t/58object.t (original)
+++ dbd-oracle/trunk/t/58object.t Thu Jan 27 07:44:38 2011
@@ -5,26 +5,27 @@
use strict;
use Data::Dumper;
-use Test::More tests => 51;
+use Test::More;
unshift @INC ,'t';
require 'nchar_test_lib.pl';
$| = 1;
-BEGIN {
- use_ok('DBI');
-}
-
$ENV{NLS_DATE_FORMAT} = 'YYYY-MM-DD"T"HH24:MI:SS';
# create a database handle
my $dsn = oracle_test_dsn();
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
-my $dbh = DBI->connect($dsn, $dbuser, '',{ RaiseError=>1,
+my $dbh;
+eval {$dbh = DBI->connect($dsn, $dbuser, '',{ RaiseError=>1,
AutoCommit=>1,
PrintError => 0,
- ora_objects => 1 });
-
+ ora_objects => 1 })};
+if ($dbh) {
+ plan tests => 50;
+} else {
+ plan skip_all => "Unable to connect to Oracle";
+}
my ($schema) = $dbuser =~ m{^([^/]*)};
# Test ora_objects flag
Modified: dbd-oracle/trunk/t/60reauth.t
==============================================================================
--- dbd-oracle/trunk/t/60reauth.t (original)
+++ dbd-oracle/trunk/t/60reauth.t Thu Jan 27 07:44:38 2011
@@ -27,7 +27,7 @@
if ($dbh) {
plan tests => 3;
} else {
- plan skip_all => "Unable to connect to Oracle ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle\n";
}
is(($dbh->selectrow_array("SELECT USER FROM DUAL"))[0], $uid1, 'uid1' );
Modified: dbd-oracle/trunk/t/70meta.t
==============================================================================
--- dbd-oracle/trunk/t/70meta.t (original)
+++ dbd-oracle/trunk/t/70meta.t Thu Jan 27 07:44:38 2011
@@ -17,7 +17,7 @@
if ($dbh) {
plan tests=>13;
} else {
- plan skip_all => "Unable to connect to Oracle as $dbuser ($DBI::errstr)\n";
+ plan skip_all => "Unable to connect to Oracle";
}
diag("type_info_all\n");
Modified: dbd-oracle/trunk/t/80ora_charset.t
==============================================================================
--- dbd-oracle/trunk/t/80ora_charset.t (original)
+++ dbd-oracle/trunk/t/80ora_charset.t Thu Jan 27 07:44:38 2011
@@ -43,13 +43,17 @@
# global variables defined in dbdimp.c
$dbh_utf8 = db_connect(1);
}
- $dbh = db_connect(0);
+ my $testcount = 8 + insert_test_count( $tdata );
- plan skip_all => "Not connected to oracle" if not $dbh;
+ $dbh = db_connect(0);
+ if ($dbh) {
+ $dbh->ora_nls_parameters ()->{NLS_CHARACTERSET} =~ m/US7ASCII/ and plan skip_all => "Database is set up as US7ASCII";
- my $testcount = 8 + insert_test_count( $tdata );
+ plan tests => $testcount;
+ } else {
+ plan skip_all => "Unable to connect to Oraclee";
+ }
- plan tests => $testcount;
show_test_data( $tdata ,0 );
drop_table($dbh);
@@ -108,7 +112,7 @@
my $p = {
AutoCommit => 1,
- PrintError => 1,
+ PrintError => 0,
FetchHashKeyName => 'NAME_lc',
ora_envhp => 0, # force fresh environment (with current NLS env vars)
};
@@ -116,7 +120,6 @@
$p->{ora_ncharset} = $ncharset if $ncharset;
my $dbh = DBI->connect($dsn, $dbuser, '', $p);
- $dbh->ora_nls_parameters ()->{NLS_CHARACTERSET} =~ m/US7ASCII/ and plan skip_all => "Database is set up as US7ASCII";
return $dbh;
}
@@ -127,4 +130,4 @@
};
}
-1;
\ No newline at end of file
+1;
Modified: dbd-oracle/trunk/t/nchar_test_lib.pl
==============================================================================
--- dbd-oracle/trunk/t/nchar_test_lib.pl (original)
+++ dbd-oracle/trunk/t/nchar_test_lib.pl Thu Jan 27 07:44:38 2011
@@ -174,7 +174,7 @@
my $dbuser = $ENV{ORACLE_USERID} || 'scott/tiger';
my $dbh = DBI->connect($dsn, $dbuser, '', {
AutoCommit => 1,
- PrintError => 1,
+ PrintError => 0,
ora_envhp => 0, # force fresh environment (with current NLS env vars)
});
return $dbh;
Modified: dbd-oracle/trunk/test.pl
==============================================================================
--- dbd-oracle/trunk/test.pl (original)
+++ dbd-oracle/trunk/test.pl Thu Jan 27 07:44:38 2011
@@ -76,8 +76,9 @@
warn "Try to connect to the database using an oracle tool like sqlplus\n";
warn "only if that works should you suspect problems with DBD::Oracle.\n";
warn "Try leaving dbname value empty and set dbuser to name/passwd\@dbname.\n";
- die "\nTest aborted.\n";
- }
+ warn "\nTest aborted cannot connect.\n";
+ exit 0;
+ }
if ($os ne 'MSWin32' and $os ne 'VMS') {
my $backtick = `sleep 1; echo Backticks OK`;
unless ($backtick) { # $! == Interrupted system call
@@ -88,6 +89,7 @@
#test_bind_csr($l);
#test_auto_reprepare($l);
&ora_logoff($l) || warn "ora_logoff($l): $ora_errno: $ora_errstr\n";
+
}
&test_intfetch_perf() if $opt_p;