DBD::mysql 4.019 and 4.020 are broken on Win32, here's how to downgrade

Edit:

ActivePerl's Jan Dubois has kindly applied a patch to DBD-mysql 4.020 on their servers, so you can just do this:


Original post:

This a warning to Win32 perl devs using DBD-mysql.

The versions 4.019 and 4.020 are broken in a rather subtle way: All SQL errors are silently ignored and in fact not even triggered, no matter what RaiseError is set to or what kind of error happens. As an example, this code will run without a complaint:

Various messages have been sent to the maintainers of DBD-mysql, including a proposal for a fix. However, implementation of a fix and release of a new version will likely take some time.

In the meantime downgrading is the only viable option, but sadly the ppm client does not make that kind of thing very easy. As such, this is the command you will need to execute to downgrade your DBD-mysql:

Note that is compiled for Perl 5.12. By changing the Perl version part of the url you can also get it for 5.8 and 5.10. For 5.14 there is no ppm available though, so if you're using that you will have to downgrade your entire Perl or try your luck with the 5.12 one.

5 Comments

Hey, sorry about this; I've implemented a test and a fix for this here:

https://github.com/hoelzro/DBD-mysql

My test isn't terribly robust; it's basically Mithaldu's example in test form. If you're a Win32 user of MySQL with some time to kill, please test my fixes to see if I got it right.

I've applied the suggested fixes for the 4.020 version to the distroprefs on the PPM build servers and forced a regeneration of all Windows PPM packages for DBD-mysql-4.020. They should be available on the PPM repo within an hour or so (6pm PST).

You'll have to explicitly uninstall DBD::mysql before reinstalling, if you already have 4.020 installed, as the package version has not been changed by the patch.

Thanks for posting about this problem. I was perplexed by this, too, but now I've been able to solve it thanks to your help.

Leave a comment

About Mithaldu

user-pic Not writing much, but often found pawing at CPAN with other #perl-cats