author | Sebastian Harl <sh@tokkee.org> | |
Wed, 9 Apr 2014 14:19:44 +0000 (16:19 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 9 Apr 2014 14:19:44 +0000 (16:19 +0200) | ||
commit | 30ea545159fe6e72bada8e621e2b6f9d59490ba2 | |
tree | 6d0cb6147901282b263dff62dcac3c96ee642303 | tree | snapshot |
parent | 723ce33d539d7089e4bf675eddf724d7d8df76b9 | commit | diff |
parser: Make sure that each comparator matcher is a host matcher.
So far, 'NOT (service|attribute).<attr> <cmp> <value>' matches did not work
correctly, because the object matcher was not correctly wrapped into a host
matcher. Since we do not currently support querying any object types besides
hosts, this was wrong.
The respective code has been moved into sdb_store_matcher_parse_cmp() which
also implements and checks the restriction on matching host objects only.
A new set of tests has been introduced which exposed this problem and which
(roughly) verifies the result of a lookup using a parsed matcher.
So far, 'NOT (service|attribute).<attr> <cmp> <value>' matches did not work
correctly, because the object matcher was not correctly wrapped into a host
matcher. Since we do not currently support querying any object types besides
hosts, this was wrong.
The respective code has been moved into sdb_store_matcher_parse_cmp() which
also implements and checks the restriction on matching host objects only.
A new set of tests has been introduced which exposed this problem and which
(roughly) verifies the result of a lookup using a parsed matcher.
src/core/store_lookup.c | diff | blob | history | |
src/frontend/grammar.y | diff | blob | history | |
t/core/store_lookup_test.c | diff | blob | history |