Re: DBD::ODBC works in perl 5.8.7 but fails in 5.8.8 and above




On 19-Sep-2006 Steve Hay wrote:
Martin J. Evans wrote:
On 19-Sep-2006 Tim Bunce wrote:
On Tue, Sep 19, 2006 at 02:47:18PM +0100, Martin J. Evans wrote:
I never really
got to the root of the problem but it appears:

in dbdimp.c did a:

svGrow(phs->sv, 50+1)

but

SvLEN(phs->sv) returns 52!

DBD::ODBC does not expect this so the test fails. Since this is
continuing to fail in all Perl versions since 5.8.8 I really would
like to get this sorted out. I've checked through the perl changes files
and
I cannot see anything that looks a possibility. Does anyone know why

If phs->sv is a SVt_NULL and you do:
SvUPGRADE(phs->sv, SVt_PVNV)
svGrow(phs->sv, 50+1)
svGrow should really be SvGROW. In fact there's no svGrow in perl
[...later...] or in DBD::ODBC. I'll assume you meant SvGROW and your
shift key got out of step.

Yes I did.

SvLEN(phs->sv) returns 52 in 5.8.8 onwards

I've not been following this thread at all, but seeing the above made
this spring to mind:

http://public.activestate.com/cgi-bin/perlbrowse?show_patch=Show+Patch&patch_n
um=24665

Perl has always been at liberty to allocate more memory than was
requested if it thinks that would be a good idea, and that is exactly
what it does as of the above patch (#24665) in order to reduce the
number of realloc()'s that might be required.

That patch was integrated into 5.8.8.

Thanks Steve, this sounds like it would cause the affect I'm seeing and was
introduced in the right perl version too. With this information I should be
able to work on a fix to DBD::ODBC.

Thanks again.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com

.



Relevant Pages