[mythtv-users] old mythvideo.DBSchemaVer

Ross Boylan RossBoylan at stanfordalumni.org
Fri Jul 27 20:48:35 UTC 2012


If anyone can confirm my diagnosis or offer suggestions for a way
forward, I'd appreciate it.

Also, would this be better directed to the developer list?

Short version: The automatic upgrade of my database from 0.24.2 to
0.25.0 fails.  The problem seems to be that my mythvideo.DBSchemaVer is
1011, while the minimum acceptable for upgrade is 1016.  Probably not
coincidentally I do not have the mythvideo package from Marillat's
repository installed (along with several others--I just got what I
needed for TV).  0.24.2 was the first version ever installed on the
machine, and so the version number could not be a hold-over from an
older install.


Thanks.
Ross


Details of the diagnosis:

Since the log shows I'm at DBSchemaVer 1266 I looked at the code in
dbcheck.cpp
(http://code.mythtv.org/doxygen/mythtv_2libs_2libmythtv_2dbcheck_8cpp_source.html).  It appears this code successively upgrade the database for each version.  The fact that I'm at 1266 indicates the upgrade code from 1266 to 1267 failed; I believe that's lines 1244-1255 (that's on the web; I'm actually using slightly older source code).  This calls doUpgradeVideoDatabaseSchema, which in turn does these checks:

00348 bool doUpgradeVideoDatabaseSchema(void)
00349 {
00350     QString dbver = gCoreContext->GetSetting("mythvideo.DBSchemaVer");
00351     if (dbver == finalVideoDatabaseVersion)
00352     {
00353         return true;
00354     }
00355 
00356     QString olddbver = gCoreContext->GetSetting("VideoDBSchemaVer");
00357     QString dvddbver = gCoreContext->GetSetting("DVDDBSchemaVer");
00358     if (dbver.isEmpty() && olddbver.isEmpty() && dvddbver.isEmpty())
00359     {
00360         if (!InitializeVideoSchema())
00361             return false;
00362         dbver = gCoreContext->GetSetting("mythvideo.DBSchemaVer");
00363     }
00364 
00365     if (dbver.isEmpty() || dbver.toInt() <  minimumVideoDatabaseVersion.toInt())
00366     {
00367         LOG(VB_GENERAL, LOG_ERR,
00368             "Unrecognized video database schema version. "
00369             "Unable to upgrade database.");
00370         LOG(VB_GENERAL, LOG_ERR, QString("mythvideo.DBSchemaVer: '%1', "
00371             "VideoDBSchemaVer: '%2', DVDDBSchemaVer: '%3'").arg(dbver)
00372                 .arg(olddbver).arg(dvddbver));
00373         return false;
00374     }
and my log shows
CoreContext videodbcheck.cpp:375 (doUpgradeVideoDatabaseSchema) - mythvideo.DBSchemaVer: '1011', VideoDBSchemaVer: '', DVDDBSchemaVer: ''.

Manual inspection of the tables confirms the version of
mythvideo.DBSchemaVer and the absence of the other keys in the settings
table.  Unfortunately minimalVideoDatabaseVersion is 1016.

BTW, my logs indicate 0.24.2 was on MythTV Schema 1264.  Note this is a
distinct sequence from mythvideo.DBSchemaVer.



More information about the mythtv-users mailing list