PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at MBAY dot NET>
Subject: Re: Bug in DBD::Sybase
Date: Nov 1 1997 12:55AM

I've found the cause:

For some reason AutoCommit is false by default, so DBD::Sybase
issues an implicit BEGIN TRANSACTION, which causes any
create table to fail. Of course there are two create table (for
temp tables) in sp_helprotect....

This will warant some more time to figure out exactly how to 
handle transactions (wrt DBI spec) and the way Sybase handles
them.

For now the fix is to add {AutoCommit => 1 } as a fourth
parameter to the DBJ->connect() call.

Michael


Michael Peppler wrote:
> 
> I've just found a weird bug in DBD::Sybase 0.05 (but it's probably
> also there in previous versions).
> 
> I was trying to port dbschema.pl from Sybase::DBlib to DBD::Sybase,
> and everything was going fine, until I tried getting the
> grant/revoke rows via sp_helprotect $objectName.
> 
> The following little script illustrates the problem:
> 
> #!/usr/local/bin/perl
> 
> use DBI;
> 
> $d = DBI->connect('dbi:Sybase:', 'sa', '');
> #$d->do('use BugTrack');
> 
> $s = $d->prepare("sp_helprotect 'sysusers'");
> $s->execute;
> print $s->errstr, "\n";
> exit(0);
> 
> Which produces the following output:
> 
> kiruna (2:55pm):21 > perl db.pl
> Server message:
> Message number: 267, Severity 16, State 1, Line 200
>  Procedure 'sp_helprotect'
> Message String: Object '#sysprotects2' cannot be found.
> 
> The same script written using the Sybase::CTlib module works fine.
> 
> I'll try to find some time to find what is causing this (it's very
> weird - it's like the temp table is dropped in the middle of the
> execution of the stored proc)...
> 
> Michael
> --
> Michael Peppler       -||-  Data Migrations Inc.
> mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler

-- 
Michael Peppler       -||-  Data Migrations Inc.
mpeppler@datamig.com  -||-  http://www.mbay.net/~mpeppler