* On Sat, Mar 07 2009, IBM OpenDev via RT wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=28655 >
>
> Hi
>
> We have recently taken over the DBD:DB2 driver. However, due to legal
> issues we cannot look at the patch since we do not have a CLA in place
> to accept the patch. However, I would look into the problem and try to
> solve the issue. If you have a repro of the problem, that would be helpful.
I don't have a simple script to reproduce the problem, but I can explain
it for you. (It's been a year or so since I've used DB2, so my memory
might be incorrect. But this is the basic idea.)
Basically, when expanding placeholders, DBD::DB2 converts "?" to ":1",
":2", and so on. It allocates one extra byte of memory for each
question mark before doing the replacing. This is fine when you only
have nine placeholders, but as you venture into the range of ":10",
":100", and ":1000", there isn't enough memory allocated to store all
the data. I noticed this causing segmentation faults in queries that
had around 2000 placeholders. The fix is to allocate the correct amount
of memory, 1 extra byte for 1-9, 2 extra bytes for 10-99, 3 extra bytes
for 100-999, and so on.
Regards,
Jonathan Rockway
--
print just => another => perl => hacker => if $,=$"