ccn has asked for the wisdom of the Perl Monks concerning the following question:

I've installed Sybase ASE 15.0.2 Developer's edition on my Ubuntu 8.4 desktop. (32bit) Unfortunately when I try to use placeholders I get segmentation fault.

#!/usr/bin/perl -l -- use strict; use warnings; use DBI; delete $ENV{LANG}; $ENV{SYBASE}='/opt/sybase'; my $dbh = DBI->connect('DBI:Sybase:server=asus','sa','') or die $DBI:: +errstr; print "Let's go!"; print $dbh->selectrow_array(<<'SQL'); select count(*) from syskeys where type = 1 SQL print "And now placeholders!"; print $dbh->selectrow_array(<<'SQL', undef, 1); select count(*) from syskeys where type = ? SQL print "END.";
ccn@asus:~/tmp$ perl sy.pl Let's go! 19 And now placeholders! ct_send(CS_DESCRIBE_INPUT) returned 0 at /usr/lib/perl5/DBD/Sybase.pm +line 124. Segmentation fault ccn@asus:~/tmp$

If I make trace then I get the following just before segfault:

dbd_preparse parameter :p1 () dbd_preparse scanned 1 distinct placeholders syb_st_prepare: ct_dynamic(CS_PREPARE) for DBD1 ct_send(CS_DESCRIBE_INPUT) returned 0 at /usr/lib/perl5/DBD/Sybase.pm +line 124. syb_st_prepare: ct_dynamic(CS_DESCRIBE_INPUT) for DBD1 syb_st_prepare: ct_results(CS_DESCRIBE_INPUT) for DBD1 - restype 4 +051 Segmentation fault

I've googled and found that the problem is more likely in CT-Library. But I do not know how to fix it.

Version of DBD::Sybase installed from Ubuntu repository is 1.00

Update:
Placeholders begin to work after upgrading DBD::Sybase to v1.09

In fact I can't say what action solved the problem. It can be the version upgrade, but I suspect that the module compilation is the deal.

Replies are listed 'Best First'.
Re: How to enable placeholders for Sybase ASE on linux?
by genehack (Beadle) on Nov 22, 2008 at 12:03 UTC
      Thanks, the problem has been solved with upgrading DBD::Sybase
Re: How to enable placeholders for Sybase ASE on linux?
by bart (Canon) on Nov 22, 2008 at 12:53 UTC
    If you can't find the help you are after here, then IMO it's best to take this kind of questions to the DBI users mailing list. It's the best resource on the web. Most DBD developers hang out there. If there's anybody who can answer this kind of question, it is them.
Re: How to enable placeholders for Sybase ASE on linux? (SOLVED)
by mpeppler (Vicar) on Dec 04, 2008 at 15:19 UTC
    The binary available with Ubuntu is most likely built with FreeTDS. While FreeTDS is a great library, it is still missing some functionality from Sybase's CTlib implementation.

    When you rebuilt the module you ended up correctly linking with the Sybase libraries, which makes things a lot smoother...

    Michael