On Tue, Jul 28, 2009 at 07:06:50PM +0100, Martin J. Evans wrote:
> Just a quick question about DBIh_SET_ERR_SV. I've produced a patch for
> DBD::Oracle and it failing to handle non-unicode strings but running our
> test code against DBI 1.609 produces a segfault. It appears:
> 
> DBIh_SET_ERR_SV(h, imp_xxh, errcode_sv, errstr_sv, &sv_undef , &sv_undef);
> 
> works fine and
> 
> DBIh_SET_ERR_SV(h, imp_xxh, errcode_sv, errstr_sv, Nullsv, Nullsv);
> 
> does not, no doubt due to the following code in set_err_sv:
> 
>   if (SvREADONLY(state))  state  = sv_mortalcopy(state);
> 
> Is that right as they seem inconsistent?

Some bits of perl internals check for null pointers and others don't.

Looks like set_err_sv() assumes it won't be given null pointers.
So don't do that :)

I'll tweak the docs in DBI::DBD.

Tim.

Reply via email to