index c1b9d01ef19494188dddd2d3dd916601715e924a..701130e88d498335c13ccc133719bca5989cda4a 100644 (file)
--- a/src/frontend/analyzer.c
+++ b/src/frontend/analyzer.c
case MATCHER_GE:
case MATCHER_GT:
assert(CMP_M(m)->left && CMP_M(m)->right);
+ if ((CMP_M(m)->left->data_type > 0)
+ && (CMP_M(m)->right->data_type > 0)
+ && (CMP_M(m)->left->data_type == CMP_M(m)->right->data_type))
+ return 0;
if ((CMP_M(m)->left->data_type > 0)
&& (CMP_M(m)->left->data_type & SDB_TYPE_ARRAY)) {
cmp_error(errbuf, m->type, CMP_M(m)->left->data_type,
/* For now, this function checks basic matcher attributes only;
* later, this may be turned into one of multiple AST visitors. */
- if (node->cmd == CONNECTION_FETCH) {
+ if (node->cmd == SDB_CONNECTION_FETCH) {
conn_fetch_t *fetch = CONN_FETCH(node);
if ((fetch->type == SDB_HOST) && fetch->name) {
sdb_strbuf_sprintf(errbuf, "Unexpected STRING '%s'", fetch->name);
filter = fetch->filter->matcher;
context = fetch->type;
}
- else if (node->cmd == CONNECTION_LIST) {
+ else if (node->cmd == SDB_CONNECTION_LIST) {
if (CONN_LIST(node)->filter)
filter = CONN_LIST(node)->filter->matcher;
context = CONN_LIST(node)->type;
}
- else if (node->cmd == CONNECTION_LOOKUP) {
+ else if (node->cmd == SDB_CONNECTION_LOOKUP) {
if (CONN_LOOKUP(node)->matcher)
m = CONN_LOOKUP(node)->matcher->matcher;
if (CONN_LOOKUP(node)->filter)
filter = CONN_LOOKUP(node)->filter->matcher;
context = CONN_LOOKUP(node)->type;
}
- else if (node->cmd == CONNECTION_TIMESERIES)
+ else if (node->cmd == SDB_CONNECTION_TIMESERIES)
return 0;
else
return -1;