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.
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.
Thanks for reacting so quickly. However I'm afraid i cannot test it. As i mentioned in my email to you: I'd love to, but i honestly have no friggin idea how to compile it on windows. I've tried multiple times, but each time just gave up and went with the stuff ActivePerl compiles for their PPM libraries from CPAN.
Unless you know someone who's actually compiled it successfully, just plain releasing and waiting for reports from people who went with the PPM packages might be the only option.
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.
Jan, thanks a lot. I just installed that and errors now cause proper crashes. I've edited the post to reflect this. :)
Rob, you can also take this as confirmation that the fix works. :D
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.