FAQ
This bug in DBD::mysql is apparently not going to be fixed:
   https://rt.cpan.org/Ticket/Display.html?id`987


and it's preventing us from inserting, eg, an i-acute character into our
database. Our customer Mr. Garc??a is Quite Irritated at this. It appears
that any non-ASCII character with code-point below 0x100 is affected
(higher codepoints like ?? and ?? and ??? are OK). As a work-around I've
done this in my application:


BEGIN {
     my $old_ex = \&DBIx::Class::Storage::DBI::_dbh_execute;
     my $new_ex = sub {
         foreach (@{$_[3]}) {
             if(exists($_->[1]) && defined($_->[1])) {
                 utf8::upgrade($_->[1])
             }
         }
         return $old_ex->(@_);
     };


     {
         no strict qw/ refs /;
         no warnings 'redefine';
         *DBIx::Class::Storage::DBI::_dbh_execute = $new_ex;
     }
}


And it appears to work. However, I don't like monkey-patching like that.
Is there a better way that I haven't been able to find in the
DBIx::Class doco?


--
David Cantrell | Hero of the Information Age


   Sobol's Law of Telecom Utilities:
     Telcos are malicious; cablecos are simply clueless.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 9 | next ›
Discussion Overview
groupdbix-class @
categoriesperl, catalyst
postedFeb 26, '15 at 2:43p
activeFeb 27, '15 at 1:33p
posts9
users4
websitedbix-class.org
irc#dbix-class

People

Translate

site design / logo © 2019 Grokbase