[mythtv] Script to test for 0.22 upgrade database corruption

Tom Dexter digitalaudiorock at gmail.com
Wed Feb 10 18:18:10 UTC 2010

As you know, the potential database corruption issues discussed here:


...are especially common under Gentoo, as they've defaulted to utf8 by
default for some time.  They intend to mark 0.22 as stable soon and
want to put together a good upgrade guide.

The big concern that many have is the inability to know if they have
"partial corruption" of the database except by finding out the hard

I've attached a perl script that performs the same corruption tests
done in mythtv/libs/libmythtv/dbcheck.cpp using temporary tables.  I
haven't upgraded to 0.22 myself, however I've already performed the
restore fix described in the wiki, and have my mysql my.cnf switched
to latin1 (which I'll switch back after the upgrade).  I tested this
script against my database and it seems to work fine, though I'd like
any feedback anyone might have.

There are a few issues that I'm especially unclear on:

1)  Are there other schema changes unrelated to these test that could
also fail (such as schema updates for specific plugins etc)?

2)  If someone hasn't yet done the backup/restore fix described in the
wiki to convert utf8 data to latin1, are these tests even valid or

The second one is my biggest concern.  I tried the test script on a
separate machine using restores of both my current (fixed) database
and on a copy from a pre-fix version and it passed on both, but I
don't think that proves much of anything.

Thanks in advance.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mythtv_0_22_corruption_test.pl
Type: text/x-perl
Size: 2748 bytes
Desc: not available
URL: <http://mythtv.org/pipermail/mythtv-dev/attachments/20100210/b76cd402/attachment.pl>

More information about the mythtv-dev mailing list