sv_setpvn error in DBD::Sybase
am 21.04.2006 15:46:41 von Hendrik.VanbelleghemHi,
I'm experiencing some problems when trying to get DBD::Sybase to consult
Micromuse Netcool ObjectServer database. I'm working on 2 solaris 64 bit
machines, both running perl 5.8.0, DBI version 1.5.0, DBD::Sybase 1.07
and FreeTDS O.63. I've applied 2 patches that are provided through the
Netcool user group site.
Most google results are about unicode but none discuss DBD::Sybase or
DBI. I suspect somewhere a unicode error has snuck in. The error I get
is 'panic: sv_setpvn called with negative strlen'. Below is the test
code I used:
#!/usr/local/bin/perl
use strict;
use DBI;=20
BEGIN { $ENV{SYBASE} =3D "/usr/local/freetds"; }
my $nco_db =3D "DEV";
my $nco_user =3D "user";
my $nco_password =3D "password";
My $serial =3D 808025;
my $dbh =3D
DBI->connect("dbi:Sybase:server=3D$nco_db","$nco_user","$nco _password",=20
{ 'RaiseError' =3D> 1, 'PrintError' =3D> 1 } ) || warn DBI::errstr();
if (!ref($dbh))=20
{ print qq(Cannot connect to ObjectServer); }
my $query =3D qq(select Field from alerts.status);
#my $query =3D qq(select FIeld from alerts.status where Serial =3D =
$serial);
my $sth =3D $dbh->prepare( $query );
$sth->execute();
my @row =3D ();
while(@row =3D $sth->fetchrow_array)
{ print join("*",@row[0..4]),"\n"; }
$sth->finish();
$dbh->disconnect();
The error is returned on the "while (@row =3D ..." line.=20
This error only manifests itself when I use the first query statement
and not the second one. It also only manifests itself on one of the two
hosts. Are there any know Unicode issues with DBD::Sybase/FreeTDS that I
should know about?
Thanks in advance
Kind regards
Hendrik Van Belleghem