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



On Tue, Sep 19, 2006 at 02:47:18PM +0100, Martin J. Evans wrote:
Hi,

Back in March this year Jonathan Gillespie reported the following
error in DBD::ODBC test suite:

Can't change param 1 maxlen (51->50) after first bind at
t/20SqlServer.t line 180.

(see http://www.mail-archive.com/dbi-users@xxxxxxxx/msg26946.html).

The same version of DBI and DBD::ODBC works fine in perl 5.8.7 but
fails in perl 5.8.8 and later. I've even tried 5.9.4. 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.

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

SvLEN is the size of the buffer allocated to the string, not the
length of the current string in the buffer (which is SvCUR).

but the same code returned 51 in 5.8.7 and earlier?

I don't have 5.8.8 handy and no time to grab it now (satellite link
down so I only have slow ISDN at the moment).

Perhaps SvLEN(phs->sv) was 52 before SvGROW was called?

Tim.
.



Relevant Pages