Subject: | Stack corruption for queries making perl callbacks (SQLITE) |
The SQLite database allows user-defined perl functions and aggregates.
A problem occurs when a user-defined function requires a non-trivial amount of memory and the perl stack gets reallocated.
For an example of this bug in DBD::SQLite, see: https://rt.cpan.org/Public/Bug/Display.html?id=84974
The following changes to Driver.xst (attached) resolves the particular issue identified above:
< ST(0) = dbdxst_fetchall_arrayref(sth, &PL_sv_undef, (maxrows_svp) ? *maxrows_svp : &PL_sv_undef);
---
Show quoted text
> SV *tmp = dbdxst_fetchall_arrayref(sth, &PL_sv_undef, (maxrows_svp) ? *maxrows_svp : &PL_sv_undef);
> SPAGAIN;
> ST(0) = tmp;
663c665,667
< ST(0) = dbdxst_fetchall_arrayref(sth, slice, batch_row_count);
---
Show quoted text> SV *tmp = dbdxst_fetchall_arrayref(sth, slice, batch_row_count);
> SPAGAIN;
> ST(0) = tmp;
Could someone more knowledgeable in DBI XS comment on if this issue might have a greater extent? Also, is this an appropriate fix for DBI -- or should DBD::SQLite not rely on the supplied Driver.xst?
Many Thanks,
Aaron Schweiger
Subject: | Driver.xst.new |
Message body not shown because it is not plain text.