Hello Michael,

I believe this is a bug with the Sybase 0.94 nsql call through func.  I
messed around with Sybase.pm and I believe the eval and catch between lines
290 and 340 is causing the problem.  When you trap the die to check if it is
a deadlock error, you don't have an 'else' of what to do if it is not a
deadlock problem.  I worked on a patch for a little while, but I got
confused on the interactions between eval, RaiseError and syb_err_handler.

If this turns out to really be a bug, I think I could patch it with a little
guidance.  But for now I think the best solution for me would be to remove
the deadlocking stuff from my local copy of DBD::Sybase.

Regards,
Mitch


#!/usr/local/bin/perl5

use strict;
use warnings;

use DBI;

my $dbh = DBI->connect(
    'dbi:Sybase:server=XXX',
    'XXX',
    'XXX',
    {
        RaiseError => 1 ,
        syb_err_handler => sub {
            print STDERR "Sybase message: ", pop;
            return 1
        }
    }
) or die 'cannot connect';

print STDERR "Sybase version: $dbh->{syb_oc_version}\n";

my $sql = 'select id, type, badcolumn from master..sysobjects';

my $h = $dbh->func($sql, 'HASH', 'nsql');

print STDERR "It didn't die!\n";

===========================================

ops@hintweb1$ ./test.pl
Sybase version: Sybase Client-Library/11.1.1/P-EBF7662/sun_svr4/SPARC
Solaris 2.5.1/1/OPT/Thu Nov 20 19:19:42 1997
Sybase message: Invalid column name 'badcolumn'.
no statement executing at
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBD/Sybase.pm line 293.
It didn't die!


===========================================
Mitch Helle-Morrissey, Software Engineer
Reuters Information Technology, Inc.

Reply via email to