[mythtv-users] DB charset pre-conversion test failed! Your database seems to be partially corrupted.

Michael T. Dean mtdean at thirdcontact.com
Mon Nov 9 19:08:37 UTC 2009

On 11/09/2009 08:54 AM, Brian J. Murrell wrote:
> On Sun, 2009-11-08 at 22:25 -0500, Michael T. Dean wrote: 
>> Most likely the same problem as: 
>> http://www.gossamer-threads.com/lists/mythtv/users/406111#406111 (which 
>> was missing tables).  Same solution, too.
> OK.  I really, really, hate to have to lose all of the settings that I
> have spent literally years honing and fine-tuning.

You'd be amazed at how quickly you'll get things set up again.  Doing it 
the first time is hugely time-consuming.  Doing it a second time is 
/much/ faster.  And, once you get it working, you can fine-tune settings 
as you notice things not working as desired.

Note, also, that the defaults are pretty good defaults--they'll get you 
most of the way there.

> Why doesn't the usual database schema upgrade handle this in a more
> graceful, less destructive manner?
> Is there something I can while running my 0,21-fixes system to prevent
> this on upgrade?  You say the problem was simply missing tables (but I
> couldn't find reference to which ones).  Can't I just simply create them
> before doing the upgrade?  Will installing certain myth
> components/packages create the needed and missing tables?  I'm most
> willing to do that.
> This really is a bug that needs to be fixed in the upgrade, IMHO.  I am
> at least the second person to run into it and making people have to grub
> through the database and lose all of their setting just to upgrade is
> not nice.

I will consider any patches that anyone *else* submits.  I have already 
spent >> 100hrs of my own time working on DB corruption issues (from 
diagnosing issues to finding ways to detect/prevent problems from those 
issues) and possible fixes, and /none/ of those issues affected me or my 
database.  I'm burned out on trying to fix ${random_corruption} in other 
users' databases.

Yes, I know that as a FOSS developer, I'm supposed to give freely of my 
time to make software better for other users, but since as soon as a 
user upgrades to 0.22 or above, all of the code I write for such issues 
is no longer useful, it's not making the software any better for the 
vast majority of users--including me.  Therefore, I feel that the time 
I've spent on the issue is enough to have scratched my itch, and I'll 
leave it to others to scratch theirs (or just spend an hour fixing their 
own DB's themselves).***

I had fully intended to create a script that:

a) tests the DB schema for charset corruption,
b) if present, determines whether it's "equal" corrution or "partial" 
c) for "equal" corruption attempts the fix mentioned on 
http://www.mythtv.org/wiki/Fixing_Corrupt_Database_Encoding ,
d) for "partial" corruption or if the "equal" corruption fix didn't 
work, attempts the fix mentioned at 
http://www.gossamer-threads.com/lists/mythtv/users/406111#406111 *both* 
using charset-converted data (from the modified backup created for step 
c) and using the non-charset-converted data (from the 
original/unmodified pre-upgrade backup)

--all the while keeping the user informed of what's happening and the 
consequences of the fix.  However, because of the amount of time I had 
already spent and the amount of time creating a "releasable-quality" 
version of such a script would take, I never got around to it.

Since the information on the 2 paths to fixing the DB is out there,


***In truth, there's one other issue I'm working on.  Namely, Qt4.5 
Qt-MySQL drivers work differently from all previous versions and prevent 
our pre-upgrade corruption test from working.  I'd like to fix it so 
that the test works regardless of installed Qt version.

Q) Wait, what?  If the pre-upgrade test doesn't work with Qt4.5, does 
that mean I can just install Qt4.5 and I won't have this problem?

A) No, it means that if you're using MythTV with Qt4.5 for the 0.22+ 
upgrade, we effectively don't test whether your database looks good 
before we upgrade.  Therefore, we will begin the upgrade and then error 
part-way through the upgrade--at a point where your *only* option is to 
restore the pre-upgrade backup and then fix the issue.  With the test, 
we will stop upgrading your database /before/ putting it into a 
partially-converted state (which is, in fact, a corrupt state).

More information about the mythtv-users mailing list