Ticket #76: single_db_exec.diff

File single_db_exec.diff, 826 bytes (added by Korey <k.m.fort@…>, 15 years ago)

Trades a DELETE and INSERT for a UPDATE call to the database.

  • mythgame/mythgame/dbcheck.cpp

     
    1515static void UpdateDBVersionNumber(const QString &newnumber)
    1616{
    1717    MSqlQuery query(MSqlQuery::InitCon());
    18 
    19     query.exec("DELETE FROM settings WHERE value='GameDBSchemaVer';");
    20     query.exec(QString("INSERT INTO settings (value, data, hostname) "
    21                           "VALUES ('GameDBSchemaVer', %1, NULL);")
    22                          .arg(newnumber));
     18        query.exec(QString("UPDATE settings SET value='GameDBSchemaVer', data=%1, hostname=NULL WHERE value='GameDBSchemaVer';").arg(newnumber));
    2319}
    2420
    2521static void performActualUpdate(const QString updates[], QString version,