]> git.notmuchmail.org Git - notmuch/commitdiff
lib: work around xapian bug with get_mset(0,0, x)
authorDavid Bremner <david@tethera.net>
Fri, 6 Apr 2018 11:43:07 +0000 (08:43 -0300)
committerDavid Bremner <david@tethera.net>
Fri, 27 Apr 2018 01:14:59 +0000 (22:14 -0300)
At least Fedora28 triggers this Xapian bug due to some toolchain change .

   https://bugzilla.redhat.com/show_bug.cgi?id=1546162

The underlying bug is fixed in xapian commit f92e2a936c1592, and
should be fixed in Xapian 1.4.6

lib/query.cc

index d633fa3d908ae08c1e1493b6caa29b8d3570c409..7fdf992de7162a758d6ea869515ad07e15aaa4a6 100644 (file)
@@ -652,9 +652,9 @@ _notmuch_query_count_documents (notmuch_query_t *query, const char *type, unsign
        /*
         * Set the checkatleast parameter to the number of documents
         * in the database to make get_matches_estimated() exact.
-        * Set the max parameter to 0 to avoid fetching documents we will discard.
+        * Set the max parameter to 1 to avoid fetching documents we will discard.
         */
-       mset = enquire.get_mset (0, 0,
+       mset = enquire.get_mset (0, 1,
                                 notmuch->xapian_db->get_doccount ());
 
        count = mset.get_matches_estimated();