On Wed, Jun 06, 2007 at 07:45:45PM -0400, Wood, David wrote:
> It took us a while to whittle this down into a small test case; however,
> the fruits of labour seem to have paid off:
>
> % perl -MDBI -e 'my $dbh =
> DBI->connect("dbi:Sybase:server=MYSERVER","janedoe","janepass"); my
> $arr_ref = $dbh->selectall_arrayref("execute sp_who"); print
> @{$arr_ref->[0]},"\n";
> Can't locate object method "DELETE" via package "DBI::st" at -e line 1.
Excellent! Good small test cases lead to quick fixes...
The real bug here is an old one - almost 5 years old - in the DBI.
Here's a quick fix for DBD::Sybase 1.08 till DBI 1.57 is released:
--- dbdimp.c.orig 2007-04-19 11:31:19.000000000 -0700
+++ dbdimp.c 2007-06-07 03:40:57.000000000 -0700
@@ -3834,6 +3834,11 @@
return Nullav;
}
+ /* workaround for bug in DBI < 1.57: fetch was called with outer */
+ /* handle by XS versions of selectall_arrayref() etc. */
+ if (SvMAGICAL(SvRV(sth)) && mg_find(SvRV(sth),'P'))
+ sth = mg_find(SvRV(sth),'P')->mg_obj; /* switch to inner handle */
+
ChopBlanks = DBIc_has(imp_sth, DBIcf_ChopBlanks);
TryAgain:
Tim.