sv_setpvn error in DBD::Sybase



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


.



Relevant Pages

  • Re: next version of DBD::ODBC including available unicode patch?
    ... It can't work, because the ODBC API only accepts non-Unicode SQL statements, or at least I did not find a way to make ODBC work with SQL strings encoded in UTF-8 or UTF-16 from a non-Unicode application like perl.exe. ... I do not have enough insight into ODBC on Win32 and the inner workings of DBI drivers to declare my patch as good enough for a release. ... For that, I would need to be sure that the code is right and works with all of DBI, not just know that it works with *one* application that uses only a small part of DBI. ...
    (perl.dbi.users)
  • Re: listbox underlining
    ... lots of unicode problems, especially while interacting with DBI ... Czech html pages often be writed in cp-1250 or utf-8 charsets. ... I buy Windows 98 in the year 2001 and Windows XP in the year 2004. ...
    (comp.lang.perl.tk)