From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E33B16DE17BE for ; Sun, 28 Feb 2016 07:46:34 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.035 X-Spam-Level: X-Spam-Status: No, score=-0.035 tagged_above=-999 required=5 tests=[AWL=-0.024, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] 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 9qjSNIVaiz6M for ; Sun, 28 Feb 2016 07:46:32 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 39F056DE14D9 for ; Sun, 28 Feb 2016 07:46:31 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84) (envelope-from ) id 1aa3Yr-0000bA-RY; Sun, 28 Feb 2016 10:47:09 -0500 Received: (nullmailer pid 5270 invoked by uid 1000); Sun, 28 Feb 2016 15:46:28 -0000 From: David Bremner To: Gaute Hope , notmuch@notmuchmail.org Subject: Re: need to call notmuch_threads_get (..) to actually move iterator In-Reply-To: <1456315381-astroid-1-8aih8mdal8-11676@strange> References: <1456315381-astroid-1-8aih8mdal8-11676@strange> User-Agent: Notmuch/0.21+26~g9404723 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Sun, 28 Feb 2016 11:46:28 -0400 Message-ID: <87d1rg4z3f.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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, 28 Feb 2016 15:46:35 -0000 Gaute Hope writes: > Hi, > > it seems to be necessary to actually call notmuch_threads_get (threads) > to move the thread iterator from a query object, just calling > notmuch_threads_move_to_next (..) is not enough: > I'm not sure of all the details, but it is true that the notmuch_threads_get has side effects in the database. In particular it allocates new thread-ids. So I can easily imagine things failing if you leave out the call. d