From: Adam Dickmeiss Date: Thu, 23 Feb 2012 08:09:48 +0000 (+0100) Subject: CCL: fix use of "term" field in sub queries X-Git-Tag: v4.2.26~1 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=0e7fdbc857d4905e67a7bdf8fe5b6c773ee47a7b CCL: fix use of "term" field in sub queries --- diff --git a/src/cclfind.c b/src/cclfind.c index e949f07..072fdab 100644 --- a/src/cclfind.c +++ b/src/cclfind.c @@ -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 { diff --git a/test/test_ccl.c b/test/test_ccl.c index 40e08c2..42ec35e 100644 --- a/test/test_ccl.c +++ b/test/test_ccl.c @@ -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",