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: DBD-Sybase-0.04 interaction with Apache::DBI
Date: Oct 10 1997 2:47PM

Timothy Kimball wrote:
> 
> Trying to run DBD-Sybase-0.04 under Apache-DBI-0.74 gives fatal errors:
> 
> [Fri Oct 10 08:35:26 1997] Can't use string ("") as a HASH ref while "strict refs" in use at /faxafloi/data1/lib/perl5/site_perl/DBD/Sybase.pm line 63.
> 
> What's happening is that Apache::DBI::connect() has this line in it:
> 
>         my @args = map { defined $_ ? $_ : "" } @_;
> 
> So arguments that aren't defined get defined as empty scalars,
> including the (optional) fourth argument \%attr. These arguments get
> passed to DBD-Sybase where $attr->{AutoCommit} is tested, and *poof*!
> 
> This looks like something that will ultimately need to be fixed in
> Apache::DBI, because it appears to violate the usage of connect() in
> the DBI documentation, but for now, workarounds appear to be:
> 
> * Always include the fourth argument ( at least, {} )
> 
> * Add "$attr ||= {};" just before line 63 in DBD::Sybperl.

I've added the following code to DBD::Sybase

	if(!defined($attr) || ref($attr) ne 'HASH') {
	    $attr = {};
	}

> 
> Other than that, looks pretty good. Now let's see about BLOBs. :)

Let me know how that goes! (not that the LongReadLen attribute
is not supported or honored yet. Use set @@textsize to increase
the size of TEXT/IMAGE read beyond 32k.

And thanks for the report!

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