Bug 1376139 - Port bug 1371945 to calendar: Finalize statements instead of resetting them. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Sun, 25 Jun 2017 20:05:19 +0200
changeset 28387 530a4148e236774c49fe403e4fc5a2d191762474
parent 28386 5f8fb8c490aa4ecbf5236a84ab6f069b85235dd7
child 28388 2a185ec18e89412466841a9755c49561f05bf142
push id1986
push userclokep@gmail.com
push dateWed, 02 Aug 2017 14:43:31 +0000
treeherdercomm-beta@b51c9adf2c9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1376139, 1371945
Bug 1376139 - Port bug 1371945 to calendar: Finalize statements instead of resetting them. rs=bustage-fix
calendar/providers/storage/calStorageUpgrade.jsm
--- a/calendar/providers/storage/calStorageUpgrade.jsm
+++ b/calendar/providers/storage/calStorageUpgrade.jsm
@@ -164,17 +164,17 @@ function getVersion(db) {
         if (version !== null) {
             // This is the only place to leave this function gracefully.
             return version;
         }
     } catch (e) {
         throw reportErrorAndRollback(db, e);
     } finally {
         if (selectSchemaVersion) {
-            selectSchemaVersion.reset();
+            selectSchemaVersion.finalize();
         }
     }
 
     throw "cal_calendar_schema_version SELECT returned no results";
 }
 
 /**
  * Backup the database and notify the user via error console of the process
@@ -356,17 +356,17 @@ function reportErrorAndRollback(db, e) {
 function ensureUpdatedTimezones(db) {
     // check if timezone version has changed:
     let selectTzVersion = createStatement(db, "SELECT version FROM cal_tz_version LIMIT 1");
     let tzServiceVersion = cal.getTimezoneService().version;
     let version;
     try {
         version = (selectTzVersion.executeStep() ? selectTzVersion.row.version : null);
     } finally {
-        selectTzVersion.reset();
+        selectTzVersion.finalize();
     }
 
     let versionComp = 1;
     if (version) {
         versionComp = Services.vc.compare(tzServiceVersion, version);
     }
 
     if (versionComp != 0) {
@@ -398,17 +398,17 @@ function ensureUpdatedTimezones(db) {
                         zonesToUpdate.push({ oldTzId: zone, newTzId: refTz.tzid });
                     }
                 }
             }
         } catch (e) {
             cal.ERROR("Error updating timezones: " + e +
                       "\nDB Error " + lastErrorString(db));
         } finally {
-            getZones.reset();
+            getZones.finalize();
         }
 
         beginTransaction(db);
         try {
             for (let update of zonesToUpdate) {
                 executeSimpleSQL(db,
                     "UPDATE cal_attendees    SET recurrence_id_tz = '" + update.newTzId + "' WHERE recurrence_id_tz = '" + update.oldTzId + "'; " +
                     "UPDATE cal_events       SET recurrence_id_tz = '" + update.newTzId + "' WHERE recurrence_id_tz = '" + update.oldTzId + "'; " +
@@ -1006,17 +1006,17 @@ upgrade.v13 = function(db, version) {
             for (let itemTable of ["events", "todos"]) {
                 let stmt = createStatement(db,
                                            "SELECT id, cal_id FROM cal_" + itemTable);
                 try {
                     while (stmt.executeStep()) {
                         calIds[stmt.row.id] = stmt.row.cal_id;
                     }
                 } finally {
-                    stmt.reset();
+                    stmt.finalize();
                 }
             }
         }
 
         for (let tblid of ["attendees", "recurrence", "properties",
                            "attachments"]) {
             addColumn(tbl, "cal_" + tblid, "cal_id", "INTEGER", db);