X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fcqlutil.c;h=43e499b2f3cf8a88cbe8f480cfa1e590412c85c1;hp=7dba5a766b733ffbd29f395d33d1d2ee92d9d603;hb=7dfff1f7b79d8a3cf5f5ed62c71f6e4c2a616072;hpb=262800f89e3280c5b594faf6eea2c98e988ee2cb diff --git a/src/cqlutil.c b/src/cqlutil.c index 7dba5a7..43e499b 100644 --- a/src/cqlutil.c +++ b/src/cqlutil.c @@ -21,7 +21,7 @@ void cql_fputs(const char *buf, void *client_data) fputs(buf, f); } -struct cql_node *cql_node_dup (NMEM nmem, struct cql_node *cp) +struct cql_node *cql_node_dup(NMEM nmem, struct cql_node *cp) { struct cql_node *cn = 0; @@ -43,6 +43,11 @@ struct cql_node *cql_node_dup (NMEM nmem, struct cql_node *cp) cn = cql_node_mk_boolean(nmem, cp->u.boolean.value); cn->u.boolean.left = cql_node_dup(nmem, cp->u.boolean.left); cn->u.boolean.right = cql_node_dup(nmem, cp->u.boolean.right); + break; + case CQL_NODE_SORT: + cn = cql_node_mk_sort(nmem, cp->u.sort.index, cp->u.sort.modifiers); + cn->u.sort.next = cql_node_dup(nmem, cp->u.sort.next); + cn->u.sort.search = cql_node_dup(nmem, cp->u.sort.search); } return cn; } @@ -141,6 +146,10 @@ struct cql_node *cql_apply_prefix(NMEM nmem, cql_apply_prefix(nmem, n->u.boolean.left, prefix, uri); cql_apply_prefix(nmem, n->u.boolean.right, prefix, uri); } + else if (n->which == CQL_NODE_SORT) + { + cql_apply_prefix(nmem, n->u.sort.search, prefix, uri); + } return n; }