From: David Bremner Date: Sun, 27 Sep 2015 15:32:01 +0000 (+2100) Subject: [Patch v4 7/9] lib: migrate notmuch_database_upgrade to new query_search API X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b6c94002ca5a8baa36fa1dd2f9b174fb2ea4f4a0;p=notmuch-archives.git [Patch v4 7/9] lib: migrate notmuch_database_upgrade to new query_search API --- diff --git a/ba/838282c28a07d50fe93dc11583e5eb9bd3af9c b/ba/838282c28a07d50fe93dc11583e5eb9bd3af9c new file mode 100644 index 000000000..72c23d84a --- /dev/null +++ b/ba/838282c28a07d50fe93dc11583e5eb9bd3af9c @@ -0,0 +1,73 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 711386DE15DD + for ; Sun, 27 Sep 2015 08:34:48 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.108 +X-Spam-Level: +X-Spam-Status: No, score=0.108 tagged_above=-999 required=5 tests=[AWL=0.108] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 7Yz9ypQt0IvA for ; + Sun, 27 Sep 2015 08:34:46 -0700 (PDT) +Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224]) + by arlo.cworth.org (Postfix) with ESMTPS id A2E706DE14F2 + for ; Sun, 27 Sep 2015 08:34:46 -0700 (PDT) +Received: from remotemail by gitolite.debian.net with local (Exim 4.80) + (envelope-from ) + id 1ZgDxk-0008F1-IB; Sun, 27 Sep 2015 15:34:04 +0000 +Received: (nullmailer pid 11943 invoked by uid 1000); Sun, 27 Sep 2015 + 15:32:11 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [Patch v4 7/9] lib: migrate notmuch_database_upgrade to new + query_search API +Date: Sun, 27 Sep 2015 12:32:01 -0300 +Message-Id: <1443367923-11867-8-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.5.3 +In-Reply-To: <1443367923-11867-1-git-send-email-david@tethera.net> +References: <1443367923-11867-1-git-send-email-david@tethera.net> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 27 Sep 2015 15:34:48 -0000 + +Here we depend on the error path cleaning up query +--- + lib/database.cc | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/lib/database.cc b/lib/database.cc +index f39d448..5e86955 100644 +--- a/lib/database.cc ++++ b/lib/database.cc +@@ -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)) + { +-- +2.5.3 +