[mythtv] [mythtv-commits] mythtv commit: r17160 - in trunk/mythtv/libs by danielk
Michael T. Dean
mtdean at thirdcontact.com
Tue Apr 29 01:58:12 UTC 2008
On 04/28/2008 09:46 PM, Nigel Pearson wrote:
>> And, finally, this adds a check for dbver != "0" before calling
>> PromptForSchemaUpgrade(), but PromptForSchemaUpgrade() is also doing a
>> check at libs/libmyth/mythcontext.cpp +3529 (
>> ). Since the "old" check--an isEmpty() check--is failing and (I'm
>> assuming) yours is working, it seems that someone (I don't see
>> where) is
>> setting dbver to 0 before the call to PromptForSchemaUpgrade()
>> this changed since Nigel(?) first wrote it).
> I'm not getting a 0. Just created a new empty DB,
> and the schema version is empty:
>> Does it make sense to
>> remove the new check and fix the one in PromptForSchemaUpgrade()?
> Even better would be to fix dbutil::BackupDB()
> to not attempt a backup if there are no tables?
That would solve the DB backup part, but not the automatically upgrading
the schema part.
Fixing BackupDB() is easy enough as I already had DBUtil::GetTables()
(with plans for that and some other stuff like the analyze, optimize,
and repair), so it would just be a simple check of the size of the
QStringList. And, it has the benefit that it handles any concerns I had
regarding not backing up "corrupt" DB's (i.e. with no settings table or
with no DBSchemaVer setting). I'll submit a patch when I get a chance
(though it will be after I finish #4760's updated patch since I'm kind
of committed to finishing that before messing with my dev system too much).
More information about the mythtv-dev