diff --git a/src/frontend/grammar.y b/src/frontend/grammar.y
index 2e5274469057b12ac195997982e4018df727268e..80fb249684e0120be85cd421905fec666d277bc4 100644 (file)
--- a/src/frontend/grammar.y
+++ b/src/frontend/grammar.y
sdb_object_deref(SDB_OBJ($3)); $3 = NULL;
}
|
- HOST_T
- {
- /* XXX: this doesn't work correctly when not
- * querying hosts => use <type>.<field> instead
- * and let the analyzer verify <type> */
- $$ = sdb_store_expr_fieldvalue(SDB_FIELD_NAME);
- }
- |
field
{
$$ = sdb_store_expr_fieldvalue($1);
METRIC_T { $$ = SDB_METRIC; }
|
ATTRIBUTE_T { $$ = SDB_ATTRIBUTE; }
+ |
+ BACKEND_T { $$ = SDB_FIELD_BACKEND; }
;
field:
sdb_store_matcher_t *m, *tmp = NULL;
assert(cb);
- /* TODO: this only works as long as queries
- * are limited to hosts */
+ /* hosts are never iterable */
if (type == SDB_HOST) {
return NULL;
}
- e = sdb_store_expr_fieldvalue(SDB_FIELD_NAME);
+ if (type == SDB_FIELD_BACKEND)
+ e = sdb_store_expr_fieldvalue(type);
+ else
+ e = sdb_store_expr_fieldvalue(SDB_FIELD_NAME);
m = cb(e, expr);
if (m_type == MATCHER_ANY)
tmp = sdb_store_any_matcher(type, m);