Just a quick update:

We switched back to using the FreeTDS driver under DBD::ODBC with the unixODBC 
ODBC manager on Linux and the segfault problem went away.

That seems to suggest to me that it's a problem with the Easysoft driver, and 
I've communicated this to the Easysoft team.

BTW, the Easysoft guys have been really terrific; responsive and knowledgeable. 
 A real pleasure to work with.  Hopefully they can track down this bug.

Eric



> -----Original Message-----
> From: Berg, Eric: IT (NYK)
> Sent: Friday, May 13, 2011 9:24 AM
> To: 'Martin J. Evans'
> Cc: dbi-users@perl.org
> Subject: RE: DBD::ODBC Segfaults on SET TEXTSIZE and TRUNCATE TABLE
> 
> Thanks, Martin.  I've been working with Richard on this for a few days and
> he's been very helpful.  Just not sure what's up here yet, but it was
> recommended that I upgrade from the 1.3 version that we've got packaged
> for use here at the bank to 1.4.  We'll see if that makes a difference.
> 
> Many of the tests of DBD::ODBC are failing as well.  I'm looking at that,
> will upgrade and report my progress back to the list.
> 
> Thanks again.
> 
> > -----Original Message-----
> > From: Martin J. Evans [mailto:martin.ev...@easysoft.com]
> > Sent: Friday, May 13, 2011 3:46 AM
> > To: Berg, Eric: IT (NYK)
> > Cc: dbi-users@perl.org
> > Subject: Re: DBD::ODBC Segfaults on SET TEXTSIZE and TRUNCATE TABLE
> >
> > On 12/05/11 21:39, eric.b...@barclayscapital.com wrote:
> > > Posted this in the Google Group, but not sure if it's going through,
> so
> > I apologize for the duplicate if that's the case.
> > >
> > > We're continuing with our struggles to get Perl working properly to
> > connect to MS SQL server, and have come up against a nasty bug that
> > results in segmentation faults when attempting to do a $dbh->do(...) to
> > set TEXTSIZE or truncate tables.
> > >
> > > I'm running the following:
> > >    Perl            : 5.012003    (x86_64-linux)
> > >    OS              : linux       (2.6.18-194.el5)
> > >    DBI             : 1.616
> > >    DBD::ODBC       : 1.29
> > >    EasySoft ODBC driver: 1.3
> > >
> > > MS SQL Server 2008.
> > >
> > > The following code generates a segfault when _ExecDirect is called at
> > DBD/ODBC.pm at line 396.
> > >
> > > my $dbh = DBI->connect("dbi:ODBC:MSSQL", $user, $password) || die
> "Error
> > connecting: $!";
> > >
> > > $dbh->{LongReadLen} = 25000;
> > > $sql = 'SELECT @@TEXTSIZE';
> > > $sth = $dbh->prepare($sql);
> > > $sth->execute();
> > >
> > > print "SQL1: $sql:\n";
> > > while ( @row = $sth->fetchrow_array ) {
> > >      print join( ", ", @row ), "\n";
> > > }
> > >
> > > $sql = 'set textsize 100';
> > > print "SQL2: $sql:\n";
> > > $sth = $dbh->do($sql);
> > > warn 0;
> > >
> > > And the output is:
> > >
> > > $ ./set_text_size_test.pl
> > > SQL1: SELECT @@TEXTSIZE:
> > > -1
> > > SQL2: set textsize 100:
> > > Segmentation fault (core dumped)
> > >
> > > and the "0" is never printed.
> > >
> > > Running this in the Perl debugger shows me that it dies at DBD::ODBC
> at
> > line 396, at which point it calls is an XS method defined in ODBC.c on
> > line 133:
> > >
> > > void
> > > _ExecDirect( dbh, stmt )
> > > SV *        dbh
> > > SV *        stmt
> > > CODE:
> > > {
> > >     STRLEN lna;
> > >     /*char *pstmt = SvOK(stmt) ? SvPV(stmt,lna) : "";*/
> > >     ST(0) = sv_2mortal(newSViv( (IV)dbd_db_execdirect( dbh, stmt ) )
> );
> > > }
> > >
> > > Anyone have any idea what might be going on here?
> > >
> > > Also, notice that the initial "SELECT @@TEXTSIZE" returns -1, which is
> > an unusual value.
> > >
> > > Thanks for any help you might be able to provide.
> > >
> > > Eric
> >
> > Eric,
> >
> > It does not segfault for me with DBD::ODBC 1.30_1 and our 1.4.18 driver.
> > I've passed your email onto Easysoft support and they should contact you
> > soon.
> >
> > Martin
> > --
> > Martin J. Evans
> > Easysoft Limited
> > http://www.easysoft.com
_______________________________________________

This e-mail may contain information that is confidential, privileged or 
otherwise protected from disclosure. If you are not an intended recipient of 
this e-mail, do not duplicate or redistribute it by any means. Please delete it 
and any attachments and notify the sender that you have received it in error. 
Unless specifically indicated, this e-mail is not an offer to buy or sell or a 
solicitation to buy or sell any securities, investment products or other 
financial product or service, an official confirmation of any transaction, or 
an official statement of Barclays. Any views or opinions presented are solely 
those of the author and do not necessarily represent those of Barclays. This 
e-mail is subject to terms available at the following link: 
www.barcap.com/emaildisclaimer. By messaging with Barclays you consent to the 
foregoing.  Barclays Capital is the investment banking division of Barclays 
Bank PLC, a company registered in England (number 1026167) with its registered 
office at 1 Churchill Place, London, E14 5HP.  This email may relate to or be 
sent from other members of the Barclays Group.
_______________________________________________

Reply via email to