From ec23af0207f771ea46693d380d00bdf5106f2c58 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 14 Jan 2005 14:32:25 +0000 Subject: [PATCH] Fixed bug #248: hit counts in combinatoric (and) searches in specific use attribute are incorrect. --- NEWS | 2 ++ include/rsisamb.h | 5 +++-- index/trunc.c | 9 ++++++--- rset/rsisamb.c | 21 ++++++++++++++++++--- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index d1c626b..daf9838 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@ --- 1.3.19 2004/XX/YY +Fixed bug #248: hit counts in combinatoric (and) searches in specific .. + Avoid crash in ISAMB when isamb_pp_open gets ISAMB_POS = 0. In this case EOF (no entries) is signalled. It fixes problem with terms being deleted. See bug #109. diff --git a/include/rsisamb.h b/include/rsisamb.h index 043e430..f78a2e6 100644 --- a/include/rsisamb.h +++ b/include/rsisamb.h @@ -1,5 +1,5 @@ -/* $Id: rsisamb.h,v 1.2 2002-08-02 19:26:55 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: rsisamb.h,v 1.2.2.1 2005-01-14 14:32:25 adam Exp $ + Copyright (C) 1995-2005 Index Data Aps This file is part of the Zebra server. @@ -33,6 +33,7 @@ extern "C" { #endif extern const struct rset_control *rset_kind_isamb; +extern const struct rset_control *rset_kind_isamb_forward; typedef struct rset_isamb_parms { diff --git a/index/trunc.c b/index/trunc.c index a3fd892..2b58645 100644 --- a/index/trunc.c +++ b/index/trunc.c @@ -1,5 +1,5 @@ -/* $Id: trunc.c,v 1.28.2.1 2004-08-11 13:31:10 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 +/* $Id: trunc.c,v 1.28.2.2 2005-01-14 14:32:25 adam Exp $ + Copyright (C) 1995-2005 Index Data Aps This file is part of the Zebra server. @@ -651,7 +651,10 @@ RSET rset_trunc (ZebraHandle zi, ISAMS_P *isam_p, int no, parms.is = zi->reg->isamb; parms.rset_term = rset_term_create (term, length, flags, term_type); - return rset_create (rset_kind_isamb, &parms); + if (res_get(zi->res, "isambforward")) + return rset_create (rset_kind_isamb_forward, &parms); + else + return rset_create (rset_kind_isamb, &parms); } qsort (isam_p, no, sizeof(*isam_p), isamd_trunc_cmp); } diff --git a/rset/rsisamb.c b/rset/rsisamb.c index 6fd7828..8639889 100644 --- a/rset/rsisamb.c +++ b/rset/rsisamb.c @@ -1,5 +1,5 @@ -/* $Id: rsisamb.c,v 1.10.2.1 2004-12-17 13:43:10 heikki Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 +/* $Id: rsisamb.c,v 1.10.2.2 2005-01-14 14:32:25 adam Exp $ + Copyright (C) 1995-2005 Index Data Aps This file is part of the Zebra server. @@ -51,7 +51,21 @@ static const struct rset_control control = r_close, r_delete, r_rewind, - r_forward, /* rset_default_forward, */ + rset_default_forward, + r_pos, + r_read, + r_write, +}; + +static const struct rset_control control_forward = +{ + "isamb", + r_create, + r_open, + r_close, + r_delete, + r_rewind, + r_forward, r_pos, r_read, r_write, @@ -62,6 +76,7 @@ static const struct rset_control control = /* negates the speedup from forwarding */ const struct rset_control *rset_kind_isamb = &control; +const struct rset_control *rset_kind_isamb_forward = &control_forward; struct rset_pp_info { ISAMB_PP pt; -- 1.7.10.4