From: Sebastian Harl Date: Sun, 1 Mar 2015 15:22:09 +0000 (+0100) Subject: analyzer: The left operand of IN may be an array as well. X-Git-Tag: sysdb-0.8.0~150 X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=commitdiff_plain;h=5250cae0891d89b863400d6aa79a3640bce975a6 analyzer: The left operand of IN may be an array as well. --- diff --git a/src/frontend/analyzer.c b/src/frontend/analyzer.c index e9e1d13..4e29fdf 100644 --- a/src/frontend/analyzer.c +++ b/src/frontend/analyzer.c @@ -256,19 +256,14 @@ analyze_matcher(int context, sdb_store_matcher_t *m, sdb_strbuf_t *errbuf) if (analyze_expr(context, CMP_M(m)->right, errbuf)) return -1; - 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, - CMP_M(m)->right->data_type); - return -1; - } + /* the left operand may be a scalar or an array but the element + * type has to match */ if ((CMP_M(m)->right->data_type > 0) && (! (CMP_M(m)->right->data_type & SDB_TYPE_ARRAY))) { cmp_error(errbuf, m->type, CMP_M(m)->left->data_type, CMP_M(m)->right->data_type); return -1; } - if ((CMP_M(m)->left->data_type > 0) && (CMP_M(m)->right->data_type > 0)) { if ((CMP_M(m)->left->data_type & 0xff)