]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
clean up stray apostrophe in comment
[notmuch] / lib / database.cc
index f39d4485076cf9e855f6d7fe2401d4b1cf1894b4..3b342f136a5397b32096987d0ad3592c43e4fc63 100644 (file)
@@ -1450,9 +1450,10 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
 
        query = notmuch_query_create (notmuch, "");
 
-       /* XXX: this should use the _st version, but needs an error
-          path */
-       for (messages = notmuch_query_search_messages (query);
+       status = notmuch_query_search_messages_st (query, &messages);
+       if (status)
+           goto DONE;
+       for (;
             notmuch_messages_valid (messages);
             notmuch_messages_move_to_next (messages))
        {
@@ -1634,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) {