public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
* Expected behaviour for absent fields
@ 2004-03-29 20:25 Adrian Ashley
  2004-03-30  3:11 ` Mel Hatzis
  0 siblings, 1 reply; 3+ messages in thread
From: Adrian Ashley @ 2004-03-29 20:25 UTC (permalink / raw)
  To: help-gnats

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" & <more clauses> & (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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-01 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-29 20:25 Expected behaviour for absent fields Adrian Ashley
2004-03-30  3:11 ` Mel Hatzis
2004-04-01 13:24   ` Adrian Ashley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).