[Dbix-class] Monkey-patching around a MySQL/UTF8 bug

David Cantrell david at cantrell.org.uk
Thu Feb 26 18:14:43 GMT 2015

On Thu, Feb 26, 2015 at 04:55:10PM +0100, Peter Rabbitson wrote:
> On 02/26/2015 03:43 PM, David Cantrell wrote:
> >This bug in DBD::mysql is apparently not going to be fixed:
> >   https://rt.cpan.org/Ticket/Display.html?id=60987
> Before we go further - is there explicit statement from the DBD devs 
> that this is not going to be fixed? Perhaps just forgotten...?

Not authoritative, no.

But it's several years old, and there are a few related tickets going
back years too. And I need a fix *now*, hence my monkey-patch. Some of
those tickets include claims that fixing it would break

> There isn't an overrideable point exposed for this, because "ugh".

That is, alas, what I expected.

> Also it never came up until now.

My patch is an adaptation of one that someone else wrote that
monkey-patched DBI instead. I guess that it didn't come up because other
people are patching closer to the bug, or they're just not mentioning
it, because "ugh".

>                             Also (as noted in that RT) - this will badly 
> break BLOB operations.

Good point. That prompted me to look over our code. We had two BLOB
fields, one of which can be replaced with a TEXT. The other really does
contain binary data, but it seems that it's getting corrupted anyway
even without my monkey-patch. Yuck.

header   FROM_DAVID_CANTRELL    From =~ /david.cantrell/i
describe FROM_DAVID_CANTRELL    Message is from David Cantrell
score    FROM_DAVID_CANTRELL    15.72 # This figure from experimentation

More information about the DBIx-Class mailing list