Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 102404
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: greg [...] turnstep.com
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 1.639



Subject: Errors needs to be slung around as SVs and respect UTF8 flag
We received a DBD::Pg bug about the UTF8 flag not being on when errors are thrown. After some debugging, it was found that it was turned on, and the correct SV was created for DBIc_ERRSTR, but that DBI copied it to a new sv without checking the flag (SV was "msg"), and then it calls croak(msg), which further prevents the flag from being kept. So it looks like two things are required: making sure that DBI keeps the flag when copying the SVs around, and using the new corak_sv when possible (obviously requires a version check, as it has been reported this is only available on Perl 5.14).
Fixed in cd4eb34, I think.
On Fri Feb 27 12:03:07 2015, TURNSTEP wrote: Show quoted text
> We received a DBD::Pg bug about the UTF8 flag not being on when errors > are thrown. After some debugging, it was found that it was turned on, > and the correct SV was created for DBIc_ERRSTR, but that DBI copied it > to a new sv without checking the flag (SV was "msg"), and then it > calls croak(msg), which further prevents the flag from being kept. So > it looks like two things are required: making sure that DBI keeps the > flag when copying the SVs around, and using the new corak_sv when > possible (obviously requires a version check, as it has been reported > this is only available on Perl 5.14).
It is possible to fix this problem also on Perl prior to 5.14. I prepared pull request which needs review: https://github.com/perl5-dbi/dbi/pull/53
Thanks for the patch pali!