Code

store: Let sdb_store_parse_object_type_plural support attributes.
authorSebastian Harl <sh@tokkee.org>
Thu, 23 Oct 2014 19:28:15 +0000 (21:28 +0200)
committerSebastian Harl <sh@tokkee.org>
Thu, 23 Oct 2014 19:28:15 +0000 (21:28 +0200)
However, the parser will not accept attributes in LIST commands as before.
Still, an attribute is considered to be a stored object.

src/core/store_lookup.c
src/frontend/grammar.y

index 7b2dcd6a246c1793412bd671d63ef3d29a81d6fd..9c2a68d21a4acce7a3abecbc6fa9067bd1ef21c7 100644 (file)
@@ -795,6 +795,8 @@ sdb_store_parse_object_type_plural(const char *name)
                return SDB_SERVICE;
        else if (! strcasecmp(name, "metrics"))
                return SDB_METRIC;
+       else if (! strcasecmp(name, "attributes"))
+               return SDB_ATTRIBUTE;
        return -1;
 } /* sdb_store_parse_object_type_plural */
 
index 722796c282726e5bc1f257bb6b6974f032064920..435b24719f3ad09173edd9463df6f664ce727c71 100644 (file)
@@ -293,7 +293,7 @@ list_statement:
        LIST IDENTIFIER filter_clause
                {
                        int type = sdb_store_parse_object_type_plural($2);
-                       if (type < 0) {
+                       if ((type < 0) || (type == SDB_ATTRIBUTE)) {
                                char errmsg[strlen($2) + 32];
                                snprintf(errmsg, sizeof(errmsg),
                                                YY_("unknown data-source %s"), $2);