]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
forbid atomic transactions on writable, upgradable databases
[notmuch] / lib / database.cc
index 5e86955d8dfd91b3880a5d53217b9265eb69c65e..3b342f136a5397b32096987d0ad3592c43e4fc63 100644 (file)
@@ -1635,6 +1635,9 @@ notmuch_database_begin_atomic (notmuch_database_t *notmuch)
        notmuch->atomic_nesting > 0)
        goto DONE;
 
+       if (notmuch_database_needs_upgrade(notmuch))
+               return NOTMUCH_STATUS_UPGRADE_REQUIRED;
+
     try {
        (static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->begin_transaction (false);
     } catch (const Xapian::Error &error) {