--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id DED70431FCF\r
+ for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 05:26:57 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.7\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.7 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id oEK8Nog5vzNj for <notmuch@notmuchmail.org>;\r
+ Wed, 14 Mar 2012 05:26:57 -0700 (PDT)\r
+Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com\r
+ [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 0E44E431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 05:26:56 -0700 (PDT)\r
+Received: by wibhm17 with SMTP id hm17so6170418wib.2\r
+ for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 05:26:55 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer;\r
+ bh=Z1uEaZctIzEOCwdRVA7bOwWXPlMSS5fiG2rp/6eCl2Q=;\r
+ b=yTKFmZWWgEwqRe7AtF1uu4Hch6rdWu8Cf8/vd3FsVySXzHta/mf0MeY7Ue3TkW4knB\r
+ gyFKcVsSwshDVfugyxcboS4chm8n9hYIw8my+iub8OOdLTkdjbr0myZSbU6f16Ui6FBC\r
+ s5h1qMMaB0pv7p0Gs7d2AeTfRq+EwOO6s86HZ+e2Z6NJuwFcrS3IsTxw3qRGAK3my9TN\r
+ vG1z9rz5s1Cvc9YMToLwhjhgjh7DSH2bUDSxoPs4jIm84z0HqEAWhtfVZLIS8IGILIRK\r
+ GIrjg+YvD3LwtyE8Szc7bZdlhUO81oAHcMn0Z6KiAo04OzzfAVidxp/nNXtOyB/FbnR9\r
+ aJtg==\r
+Received: by 10.180.24.66 with SMTP id s2mr5956550wif.7.1331728015580;\r
+ Wed, 14 Mar 2012 05:26:55 -0700 (PDT)\r
+Received: from localhost (94-192-233-223.zone6.bethere.co.uk.\r
+ [94.192.233.223]) by mx.google.com with ESMTPS id\r
+ d7sm15991026wiz.6.2012.03.14.05.26.53 (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Wed, 14 Mar 2012 05:26:54 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v2 0/3] Add test and fix exclude bug\r
+Date: Wed, 14 Mar 2012 12:26:51 +0000\r
+Message-Id: <1331728014-32698-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 14 Mar 2012 12:26:58 -0000\r
+\r
+The test in the previous patches\r
+id:"1331551914-28323-1-git-send-email-markwalters1009@gmail.com"\r
+triggered the bug accidentally. It accidentally set the exclude tags\r
+to be "=" and "deleted" rather than just "deleted". The non-existent\r
+"=" tag (i.e., the tag that does not occur anywhere in the Xapian\r
+database) triggered the bug. First we correct the tests to just set\r
+the "deleted" tag, then we add some tests including one with a\r
+deliberately non-existent tag. Finally, we modify the exclusion code\r
+to avoid the bug.\r
+\r
+The modification also appears to fix a similar problem for jrollins\r
+that I have not yet been able to reproduce.\r
+\r
+Since the code is now more clearly correct, cleaner and we do\r
+definitely avoid a Xapian bug I think these patches can be committed\r
+even without knowing why it fixed jrollins' bug.\r
+\r
+Finally these apply to current master (not to the --with-excluded series).\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+Mark Walters (3):\r
+ test: the test for the exclude code mistakenly excludes the tag "="\r
+ test: add tests for message only search\r
+ lib: fix an exclude bug\r
+\r
+ lib/query.cc | 5 +++--\r
+ test/count | 2 +-\r
+ test/search | 19 ++++++++++++++++++-\r
+ 3 files changed, 22 insertions(+), 4 deletions(-)\r
+\r
+-- \r
+1.7.9.1\r
+\r