summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dbba6b8)
raw | patch | inline | side by side (parent: dbba6b8)
| author | Sebastian Harl <sh@tokkee.org> | |
| Wed, 20 May 2015 08:32:37 +0000 (10:32 +0200) | ||
| committer | Sebastian Harl <sh@tokkee.org> | |
| Wed, 20 May 2015 08:32:37 +0000 (10:32 +0200) |
Else, the analyzer may reject valid queries. It's up to the caller to run the
analyzer using the right context once it's known.
analyzer using the right context once it's known.
| src/parser/analyzer.c | patch | blob | history |
diff --git a/src/parser/analyzer.c b/src/parser/analyzer.c
index f352a0d630cf2ae5d7e69534658e4493724a1e3e..28d312142ddca8a33b580d06b1503d4d2248de7d 100644 (file)
--- a/src/parser/analyzer.c
+++ b/src/parser/analyzer.c
return -1;
}
- if ((context != SDB_ATTRIBUTE) && (v->type == SDB_FIELD_VALUE)) {
- sdb_strbuf_sprintf(errbuf, "Invalid expression %s.value",
- SDB_FIELD_TO_NAME(v->type));
- return -1;
+ if (context != UNSPEC_CONTEXT) {
+ /* skip this check if we don't know the context; it's up to the
+ * caller to check again once the right context information is
+ * available */
+ if ((context != SDB_ATTRIBUTE) && (v->type == SDB_FIELD_VALUE)) {
+ sdb_strbuf_sprintf(errbuf, "Invalid expression %s.value",
+ SDB_FIELD_TO_NAME(context));
+ return -1;
+ }
}
return 0;
} /* analyze_value */