projects
/
idzebra-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Issue diagnostic for scan if 'set' in @attr 8=set does not exist.
[idzebra-moved-to-github.git]
/
index
/
rpnscan.c
diff --git
a/index/rpnscan.c
b/index/rpnscan.c
index
1e54721
..
242ab45
100644
(file)
--- a/
index/rpnscan.c
+++ b/
index/rpnscan.c
@@
-1,4
+1,4
@@
-/* $Id: rpnscan.c,v 1.6 2007-03-19 21:50:39 adam Exp $
+/* $Id: rpnscan.c,v 1.10 2007-05-08 14:49:38 adam Exp $
Copyright (C) 1995-2007
Index Data ApS
Copyright (C) 1995-2007
Index Data ApS
@@
-37,6
+37,7
@@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <attrfind.h>
#include <charmap.h>
#include <rset.h>
#include <attrfind.h>
#include <charmap.h>
#include <rset.h>
+#include <yaz/oid_db.h>
#define RPN_MAX_ORDS 32
#define RPN_MAX_ORDS 32
@@
-242,7
+243,11
@@
static ZEBRA_RES rpn_scan_ver2(ZebraHandle zh, ODR stream, NMEM nmem,
if (trans_scan_term(zh, zapt, termz+prefix_len, index_type) ==
ZEBRA_FAIL)
if (trans_scan_term(zh, zapt, termz+prefix_len, index_type) ==
ZEBRA_FAIL)
+ {
+ for (i = 0; i < ord_no; i++)
+ wrbuf_destroy(ar[i].term);
return ZEBRA_FAIL;
return ZEBRA_FAIL;
+ }
wrbuf_rewind(ar[i].term);
wrbuf_puts(ar[i].term, termz + prefix_len);
ar[i].isam_p = 0;
wrbuf_rewind(ar[i].term);
wrbuf_puts(ar[i].term, termz + prefix_len);
ar[i].isam_p = 0;
@@
-360,6
+365,9
@@
static ZEBRA_RES rpn_scan_ver2(ZebraHandle zh, ODR stream, NMEM nmem,
*list = glist;
*list = glist;
+ for (i = 0; i < ord_no; i++)
+ wrbuf_destroy(ar[i].term);
+
return ZEBRA_OK;
}
return ZEBRA_OK;
}
@@
-376,7
+384,7
@@
struct scan_info {
};
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
};
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
- oid_value attributeset,
+ const Odr_oid *attributeset,
int num_bases, char **basenames,
int *position, int *num_entries, ZebraScanEntry **list,
int *is_partial, RSET limit_set)
int num_bases, char **basenames,
int *position, int *num_entries, ZebraScanEntry **list,
int *is_partial, RSET limit_set)
@@
-396,8
+404,8
@@
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
*list = 0;
*is_partial = 0;
*list = 0;
*is_partial = 0;
- if (attributeset == VAL_NONE)
- attributeset = VAL_BIB1;
+ if (!attributeset)
+ attributeset = yaz_oid_attset_bib_1;
if (!limit_set) /* no limit set given already */
{
if (!limit_set) /* no limit set given already */
{
@@
-415,7
+423,6
@@
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
if (termset_value_numeric != -2)
{
if (termset_value_numeric != -2)
{
-
sprintf(resname, "%d", termset_value_numeric);
termset_name = resname;
}
sprintf(resname, "%d", termset_value_numeric);
termset_name = resname;
}
@@
-423,11
+430,19
@@
ZEBRA_RES rpn_scan(ZebraHandle zh, ODR stream, Z_AttributesPlusTerm *zapt,
termset_name = termset_value_string;
limit_set = resultSetRef (zh, termset_name);
termset_name = termset_value_string;
limit_set = resultSetRef (zh, termset_name);
+
+ if (!limit_set)
+ {
+ zebra_setError(zh,
+ YAZ_BIB1_SPECIFIED_RESULT_SET_DOES_NOT_EXIST,
+ termset_name);
+ return ZEBRA_FAIL;
+ }
}
}
}
}
- yaz_log(YLOG_DEBUG, "position = %d, num = %d set=%d",
- *position, *num_entries, attributeset);
+ yaz_log(YLOG_DEBUG, "position = %d, num = %d",
+ *position, *num_entries);
if (zebra_maps_attr(zh->reg->zebra_maps, zapt, &index_type, &search_type,
rank_type, &complete_flag, &sort_flag))
if (zebra_maps_attr(zh->reg->zebra_maps, zapt, &index_type, &search_type,
rank_type, &complete_flag, &sort_flag))