Dear Tim,

I was just getting ready to ship DBD::Informix 2004.02 when I made the 
mistake of testing it with Perl 5.6.1 and DBI 1.46.
I ran into problems with a DBD::Informix test that was expecting an error 
code to be set in a $SIG{__WARN__} handler.
Perl 5.8.5 and 5.8.6 are fine with it, I hasten to add.

I went back and tested DBD::Informix 2003.04 with DBI 1.46 and Perl 5.6.1, 
and it fails too.
Then I tested DBD::Informix 2003.04 with DBI 1.38 (no problem), DBI 1.42 
(no problem), DBI 1.43 (problem).
I don't happen to have DBI 1.44, but that only lasted a day or two before 
being replaced with DBI 1.45 (which fails, of course).
I did a 'make clean' before rebuilding DBD::Informix each time.

The test code isn't the simplest, playing with the %SIG hash.  The test is 
t/t60unlog.t (you could get the original from CPAN if you need it), but 
the relevant section is:

my $msg;
$SIG{__WARN__} = sub { $msg = $_[0]; };
print "# I'm here\n";
$dbh = DBI->connect("dbi:Informix:$dbname", $user, $pass, { AutoCommit => 
0, PrintError => 1 });
$SIG{__WARN__} = 'DEFAULT';
print "# Connection failed - which is the correct response\n" if (!defined 
$dbh);
print "ok 7\n" if (!defined $dbh);
print "not ok 8\n" unless($msg && $msg =~ /-256:/);
print $DBI::errstr;

This is a negative test - the connection is supposed to fail because the 
database cannot work with autocommit off, and the error generated happens 
to be -256 (Transaction not available).

The comparison in the last-but-one line is failing - instead of the -256 
message number plus colon, the code is seeing '(no error string)', even 
though when I subsequently print $DBI::errstr, the correct message is 
visible.

(The code above is a translation - the print statements are actually calls 
to DBD::Informix::TestHarness functions which do the printing.  The "I'm 
here" message actually reflects the connection string. The ok message is 
generated by &stmt_ok(), and the failure by &stmt_fail()), and the print 
$DBI::errstr occurs in &stmt_err(), called from &stmt_fail()).

As I noted above, Perl 5.8.x seems to be quite happy -- I've not yet gone 
back to check 5.8.0 -- but 5.6.1 is not.  And all that's changing between 
the working and the failing code is the version of DBI.  I built the Perl 
in 2001.
It happens to be running on Solaris 8 (but was built on Solaris 7) with 
GCC 2.95.3 (now using 3.4.3).

--
Jonathan Leffler ([EMAIL PROTECTED])
STSM, Informix Database Engineering, IBM Data Management
4100 Bohannon Drive, Menlo Park, CA 94025
Tel: +1 650-926-6921   Tie-Line: 630-6921
      "I don't suffer from insanity; I enjoy every minute of it!"

Reply via email to