From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26661 invoked from network); 29 Mar 2004 11:19:15 -0000 Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173) by sources.redhat.com with SMTP; 29 Mar 2004 11:19:15 -0000 Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B7uib-00045i-3i for listarch-gnats-devel@sources.redhat.com; Mon, 29 Mar 2004 06:14:13 -0500 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B7uhu-0003z0-H1 for help-gnats@gnu.org; Mon, 29 Mar 2004 06:13:30 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B7uhD-0003bx-UX for help-gnats@gnu.org; Mon, 29 Mar 2004 06:13:19 -0500 Received: from [63.70.210.59] (helo=mms2.broadcom.com) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B7ufN-000373-TR for help-gnats@gnu.org; Mon, 29 Mar 2004 06:10:54 -0500 Received: from 63.70.210.1 by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (MMS v5.6.0)); Mon, 29 Mar 2004 03:10:37 -0800 X-Server-Uuid: 011F2A72-58F1-4BCE-832F-B0D661E896E8 Received: from mail-cbga-1.eu.broadcom.com (mail-cbga-1.eu.broadcom.com [10.177.128.40]) by mon-irva-11.broadcom.com (8.9.1/8.9.1) with ESMTP id DAA25427 for ; Mon, 29 Mar 2004 03:09:59 -0800 ( PST) Received: from fruitfly.eu.broadcom.com (fruitfly [10.177.128.94]) by mail-cbga-1.eu.broadcom.com (8.12.9/8.8.8/MS01) with SMTP id i2TBAViG022521 for ; Mon, 29 Mar 2004 12:10:32 +0100 (BST) Date: Mon, 29 Mar 2004 20:25:00 -0000 From: "Adrian Ashley" To: help-gnats@gnu.org Message-ID: <20040329121031.491a0f4e.adrian.ashley@broadcom.com> Organization: Broadcom UK Ltd X-Mailer: Sylpheed version 0.9.9 (GTK+ 1.2.10; i686-pc-linux-gnu) MIME-Version: 1.0 X-WSS-ID: 6C76DBA71PW5374228-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Expected behaviour for absent fields X-BeenThere: help-gnats@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: General discussion about GNU GNATS List-Archive: List-Post: List-Help: List-Subscribe: , Sender: help-gnats-bounces+listarch-gnats-devel=sources.redhat.com@gnu.org Errors-To: help-gnats-bounces+listarch-gnats-devel=sources.redhat.com@gnu.org X-SW-Source: 2004-q1/txt/msg00182.txt.bz2 I have a GNATS-4 installation with a number of additional fields in the database. In this example, "fix-rel" is one of these - defined thusly: field "fix-rel" { description "fix release" text matching { "^$" "^(VE|IP)(_[0-9]\+)\+$" } textsearch } i.e. the empty string or specially formed tag names are allowed. The other thing to note is that this field isn't included in the initial-entry fields. One of our users reports a peculiarity: a query like this: $ query-pr --expr \ 'category=="foo" & & (fix-rel != "VE_6")' doesn't match PRs for which this field is not yet set - and there doesn't seem to be any way for him to work around this. Looking at query.c:fieldCompare() and field.c:get_field_value(), it seems that the latter returns NULL for a field which is not yet set, and the former concludes that if either of its field values are NULL, the comparison must be false. It looks like the right fix is in fieldCompare(), to cope with NULL meaning empty. Has anyone been near this code and could advise whether I'll be breaking something else by doing this? Or is the problem that my database has fields that can be unset - am I breaking some rule? Thanks, Adrian Ashley Broadcom Corp. _______________________________________________ Help-gnats mailing list Help-gnats@gnu.org http://mail.gnu.org/mailman/listinfo/help-gnats