sv_setpvn error in DBD::Sybase
- From: Hendrik.Vanbelleghem@xxxxxxxxxxx (Hendrik Vanbelleghem)
- Date: Fri, 21 Apr 2006 15:46:41 +0200
Hi,
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;
BEGIN { $ENV{SYBASE} = "/usr/local/freetds"; }
my $nco_db = "DEV";
my $nco_user = "user";
my $nco_password = "password";
My $serial = 808025;
my $dbh =
DBI->connect("dbi:Sybase:server=$nco_db","$nco_user","$nco_password",
{ 'RaiseError' => 1, 'PrintError' => 1 } ) || warn DBI::errstr();
if (!ref($dbh))
{ print qq(Cannot connect to ObjectServer); }
my $query = qq(select Field from alerts.status);
#my $query = qq(select FIeld from alerts.status where Serial = $serial);
my $sth = $dbh->prepare( $query );
$sth->execute();
my @row = ();
while(@row = $sth->fetchrow_array)
{ print join("*",@row[0..4]),"\n"; }
$sth->finish();
$dbh->disconnect();
The error is returned on the "while (@row = ..." line.
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
.
- Prev by Date: RE: last insert id
- Next by Date: RE: last insert id
- Previous by thread: Is Class::DBI slow?
- Next by thread: how to set a DEFAULT value !!
- Index(es):
Relevant Pages
|