Toast. (My setup, that is - failed upgrade, flagged as "partial corruption".)
Sometime a year or two back, there was some sort of notice about diddling with the mythtv database. I followed all of the directions. I know there was something in there about setting my.cnf to latin1, and something about dropping and reloading mythconverg. I don't remember too much more, only that I followed directions carefully.
When getting prepped for 0.22, I noticed that my.cnf once again had utf8. I don't know how that happened, whether the directory wasn't properly protected from automatic updates, or whether I missed one when doing etc-update. THAT is what I blame for the current problem - I had "corrected" the database long ago, following directions, and some time later my.cnf got switched back. I also connected my daughter's Ubuntu machine as a client, but I'm under the impression that only Gentoo keeps the default utf8 - everyone else switches it to latin1. At any rate, I can't easily inspect her machine, at the moment.
I tried your "fixit" script and it failed:
user@localhost ~/computers/mythtv $ ./mythtv_0_22_corruption_upd.pl
Testing people...
DBD::mysql::db do failed: Duplicate entry 'Frank Hubner' for key 2 at ./mythtv_0_22_corruption_upd.pl line 149.
Error updating with: UPDATE people SET name=? WHERE person=? | Frank Hubner 47378
Not sure where I'll go, at the moment. I have everything saved so I could go back to 0.21 in case there's some other way to correct the mess.
A couple of thoughts about your fixit script... I don't presume to get you to be coding for me - I presume you want this for yourself or others in this same pickle. I also don't really know perl or mysql. It looks to me like you:
1 - Found a string that was the name of a row, and that string had a bad character init.
2 - "Fixed" the string by changing the bad character to the nearest legal character.
3 - Tried to update the row, and in this case failed. (Frank Hubner - 2 dots over the "u", is a movie producer - 45 entries as producer, one in the works, and 2 credits as "other" in IMDB.)
It looks as if you made the update request, mysql failed it, and you reported that failure.
If you're interested might I suggest something slightly different?
4 - If the update fails, translate the string again, and try the update with that.
I suspect that in most cases there won't be many ways a collision can happen - probably umlauts (the 2 dots?) and the funny "~" sign being the most common. I'm not sure, but I think the "modifiers" tend to be different for consonants than vowels, making collisions less likely. Anyway, lets say "Hubner" with the umlaut collides with "Hubner" without the umlaut, causing a failure. In that event, I would suggest changing it to HUbner (umlaut "u" to capital "U") and see if that works. In other words, for a first collision simply flip the case. It leaves the rows unique, and the presence of a capital in the middle of a word, or a lower-case at the beginning, makes it pretty obvious what has happened.
If there's a second collision, I would suggest "Hu1bner", assuming the string length can change, "Hu2bner" for a third collision, etc. Ugly, but obvious. Perhaps even obvious enough to craft a few lines to manually fix.
One other question, and that's if it's possible to query if the new row name exists prior to trying the UPDATE. Perhaps cleaner, but I don't know if there's any real value to that, anyway.
Again, I don't presume to be asking you to code for me, I figure you're interested in this for your own purposes. I've looked at your code a few times, and I can get out of a paper bag pretty well with python, but not much perl, and never mysql. So I don't know what are perl-isms and what are mysql-isms.
By the way, I did this entire process against a "cp -a" copy of "/var/lib/mysql", so I still have my original as well as an extra copy of the original. I'm trying to decide now what to do. From everything I've seen, it looks to me like the "partial corruption" recovery isn't going to work, because the very tables they're trying to rescue are corrupted. Ironically, since I don't touch the configuration that often, very likely the tables they're throwing away are clean.
While I've got 0.22 installed, along with good backups of 0.21 and my data, I may well try the "partial corruption" fix and see what the results look like. I guess first I can do a drop/reload too, and see if that does any good.
Assuming everything "normal" fails, and at the moment I am, I've got to either decide to go back to 0.21, in case I/we can figure out a way to repair, or blow it all away and go to 0.22.