CCL: fix use of "term" field in sub queries
authorAdam Dickmeiss <adam@indexdata.dk>
Thu, 23 Feb 2012 08:09:48 +0000 (09:09 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Thu, 23 Feb 2012 08:09:48 +0000 (09:09 +0100)
src/cclfind.c
test/test_ccl.c

index e949f07..072fdab 100644 (file)
@@ -1022,7 +1022,7 @@ static struct ccl_rpn_node *search_elements(CCL_parser cclp,
             break;
         lookahead = lookahead->next;
     }
-    if (qa)
+    if (qa || lookahead->kind == CCL_TOK_LP)
         return search_terms(cclp, qa);
     else
     {
index 40e08c2..42ec35e 100644 (file)
@@ -264,6 +264,8 @@ void tst1(int pass)
 
     YAZ_CHECK(tst_ccl_query(bibset, "date=1980",
                             "@attr 2=3 1980 "));
+    YAZ_CHECK(tst_ccl_query(bibset, "(date=1980)",
+                            "@attr 2=3 1980 "));
     YAZ_CHECK(tst_ccl_query(bibset, "date=234-1990",
                             "@and @attr 2=4 234 @attr 2=2 1990 "));
     YAZ_CHECK(tst_ccl_query(bibset, "date=234- 1990",