From: Adam Dickmeiss Date: Wed, 7 Mar 2012 11:46:37 +0000 (+0100) Subject: CQL: fix extra terms in wrong order X-Git-Tag: v4.2.29~6 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=67263adf9c8efbd384b09ec71b98844ce7c7d2bf;ds=sidebyside CQL: fix extra terms in wrong order --- diff --git a/src/cql.y b/src/cql.y index 128dc87..cf6995e 100644 --- a/src/cql.y +++ b/src/cql.y @@ -162,10 +162,10 @@ searchTerm extraTerms { ; extraTerms: -extraTerms SIMPLE_STRING { +SIMPLE_STRING extraTerms { struct cql_node *st = cql_node_mk_sc(((CQL_parser) parm)->nmem, - /* index */ 0, /* rel */ 0, $2.buf); - st->u.st.extra_terms = $1.cql; + /* index */ 0, /* rel */ 0, $1.buf); + st->u.st.extra_terms = $2.cql; $$.cql = st; } | diff --git a/test/cql/11.2.out b/test/cql/11.2.out index 58fd9bd..aaa51fb 100644 --- a/test/cql/11.2.out +++ b/test/cql/11.2.out @@ -4,6 +4,6 @@ = a - c b + c diff --git a/test/cql/11.4.out b/test/cql/11.4.out index 37dbf3f..ef54784 100644 --- a/test/cql/11.4.out +++ b/test/cql/11.4.out @@ -4,6 +4,6 @@ = and - c b + c diff --git a/test/cql/11.7.out b/test/cql/11.7.out index 6073292..0d59eb1 100644 --- a/test/cql/11.7.out +++ b/test/cql/11.7.out @@ -9,9 +9,9 @@ = dc.title - c - b a + b + c diff --git a/test/test_cql2ccl.c b/test/test_cql2ccl.c index 95c1ad7..c050f7e 100644 --- a/test/test_cql2ccl.c +++ b/test/test_cql2ccl.c @@ -141,6 +141,8 @@ static void tst(void) YAZ_CHECK(tst_query("title = \"x y\"", "title=\"x y\"")); YAZ_CHECK(tst_query("title = x y", "title=\"x\" \"y\"")); + YAZ_CHECK(tst_query("title = x y z", "title=\"x\" \"y\" \"z\"")); + YAZ_CHECK(tst_query("dc.title=encyclopedia prox dinosaurs", "(dc.title=\"encyclopedia\") % (\"dinosaurs\")")); YAZ_CHECK(tst_query("dc.title=encyclopedia prox/distance<=3 dinosaurs",