On Tue, 2008-08-26 at 15:31 +0100, Martin Evans wrote: > David Mansfield wrote: > > Hi All, > > > > I submitted a bug via the email interface to rt: bug-dbd-oracle at > > rt.cpan.org, but I have no reason to believe that bug report got > > through. I didn't want to have to register a bunch of places to submit > > a bug, but I'm willing to if its the only way. Otherwise, is there > > someplace I can see if my bug got through correctly? > > http://rt.cpan.org/Public/Dist/Display.html?Name=DBD-Oracle > > Doesn't look like it did. > > > Here's the text of my report FWIW: > > > > Subject: execute_array does not honor UTF8 flag like execute does (and > > like docs say it should) > > > > Body: > > > > Hi All. > > > > When a statement with placeholders is 'execute'd then DBD::Oracle > > follows the docs as per the section 'Sending Data using Placeholders', > > with respect to bound variables with the utf8 flag set (i.e a "Perl > > Unicode string"). > > > > However, if 'execute_array' is used, only the NLS_LANG controls this > > behavior (and database values can be corrupted as a result). > > > > This appears to be due to the fact that dbdimp.c:do_bind_array_exec > > doesn't (actually CAN'T) have the same logic that the the other 'rebind' > > methods have for handling UTF8. > > > > My suggestion: > > > > * execute and execute_array MUST have the exact same semantics > > > > * in the guts of ora_st_execute_array, have the code check in the nested > > 'for' loops over the data for consistency of the utf8 flag across the > > entire list of values for a given placeholder > > > > * if all of the values are UTF8, use the existing approach as the normal > > bind (check csform, csid etc) > > > > * if some values are UTF8, others are not, croak with "cannot mix > > Unicode and native encoding in execute_array for placeholder :foo" > > > > I'm not subscribed to anything, so if possible, cc me on any follow ups? > > > > Thanks, > > David > > > > > > > > Interesting issue. I have a lot of execute_array calls with utf-8 data > so I'll go away and check where and when I have NLS_LANG set. > > The DBD::Oracle maintainer is on this list but I cannot comment as to > his preference for how bugs are reported.
I've created a 'test case' perl script if anyone would like to check it out. It works (ie. exposes the bug) for me on Fedora 9 (perl 5.10.0) with DBD Oracle 1.22, and on Centos 4 (perl 5.8.5) same DBD version. Let me know if I can supply any more info. Thanks, David
utf8test.pl
Description: Perl program
