Skip to Content.
Sympa Menu

freetds - [freetds] Strange bug in freetds

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Ravi Krishna <rkusenet AT hotmail.com>
  • To: <freetds AT lists.ibiblio.org>
  • Subject: [freetds] Strange bug in freetds
  • Date: Wed, 12 Oct 2011 13:32:45 -0400




Version Freetds 0.82, DBI 1.53 and DBD 1.08OS: Linux 64 bit RHEL5
Is this a DBD/DBI issue or freetds issue?
This code works like a charm
use strict ;use DBI ;my $dbh = DBI->connect("DBI:Sybase:server=..."; # passwd
removed$dbh->{PrintError} = 1 ;$dbh->{RaiseError} = 1 ;$dbh->do("begin
tran");$dbh->do("insert into rrr values(1)");$dbh->do("insert into rrr
values(1)");$dbh->do("insert into rrr values(1)");$dbh->do("commit
tran");$dbh->disconnect ;exit(0);
# All I am doing above is to insert three rows with a tran and then commit it.

# This one fails. This one prepares the insert statement instead of literal
sql.
use strict ;use DBI ;my $dbh = DBI->connect("DBI:Sybase:server=..."; # passwd
removed$dbh->{PrintError} = 1 ;$dbh->{RaiseError} = 1 ;my $sth =
$dbh->prepare("insert into rrr values(?)") ;$dbh->do("begin
tran");$sth->execute(1);$sth->execute(1);$sth->execute(1);$dbh->do("commit
tran");$dbh->disconnect ;exit(0);
DBD::Sybase::db do failed: Server message number=3902 severity=16 state=1
line=1 server=aaa text=The COMMIT TRANSACTION request has no corresponding
BEGIN TRANSACTION. at ./x.pl line 13.DBD::Sybase::db do failed: Server
message number=3902 severity=16 state=1 line=1 server=aaa text=The COMMIT
TRANSACTION request has no corresponding BEGIN TRANSACTION. at ./x.pl line 13.
# OK so I added the following:
$dbh->{AutoCommit} = 0 ;
#Now I get this error
Panic: Can't have multiple statement handles on a single database handle when
AutoCommit is OFF at
..perlmod/lib/site_perl/5.8.9/x86_64-linux-thread-multi/DBD/Sybase.pm line
129.Issuing rollback() for database handle being DESTROY'd without explicit
disconnect() at
../perlmod/lib/site_perl/5.8.9/x86_64-linux-thread-multi/DBD/Sybase.pm line
129.


  • [freetds] Strange bug in freetds, Ravi Krishna, 10/12/2011

Archive powered by MHonArc 2.6.24.

Top of Page