From 67263adf9c8efbd384b09ec71b98844ce7c7d2bf Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 7 Mar 2012 12:46:37 +0100 Subject: [PATCH] CQL: fix extra terms in wrong order --- src/cql.y | 6 +++--- test/cql/11.2.out | 2 +- test/cql/11.4.out | 2 +- test/cql/11.7.out | 4 ++-- test/test_cql2ccl.c | 2 ++ 5 files changed, 9 insertions(+), 7 deletions(-) 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", -- 1.7.10.4